mirror of
https://github.com/buger/goreplay.git
synced 2024-04-21 12:32:02 +00:00
Replace the use of bufio.Scanner with bufio.Reader so that requests over 64Kb in size can be replayed from a capture file.
This commit is contained in:
@@ -53,6 +53,18 @@ func (i *TestInput) EmitLargePOST() {
|
||||
rs := base64.URLEncoding.EncodeToString(rb)
|
||||
|
||||
i.data <- []byte("POST / HTTP/1.1\nHost: www.w3.org\nContent-Length:5242880\r\n\r\n" + rs)
|
||||
Debug("Sent large POST")
|
||||
}
|
||||
|
||||
// EmitSizedPOST emit a POST with a payload set to a supplied size
|
||||
func (i *TestInput) EmitSizedPOST(payloadSize int) {
|
||||
rb := make([]byte, payloadSize)
|
||||
rand.Read(rb)
|
||||
|
||||
rs := base64.URLEncoding.EncodeToString(rb)
|
||||
|
||||
i.data <- []byte("POST / HTTP/1.1\nHost: www.w3.org\nContent-Length:5242880\r\n\r\n" + rs)
|
||||
Debug("Sent large POST")
|
||||
}
|
||||
|
||||
// EmitOPTIONS emits OPTIONS request, similar to GET
|
||||
|
||||
Reference in New Issue
Block a user