Skip to content

Commit

Permalink
Merge branch 'valyala:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
tylitianrui committed Feb 5, 2024
2 parents 7c1989d + 48dd2d0 commit 552e056
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions fuzz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ func FuzzResponseReadLimitBody(f *testing.F) {
f.Add([]byte("HTTP/1.1 200 OK\r\nContent-Type: aa\r\nContent-Length: 10\r\n\r\n9876543210"), 1024)

f.Fuzz(func(t *testing.T, body []byte, max int) {
if max > 1024*1024 { // Skip limits higher than 1MB.
return
}
// Don't do bodies bigger than 10kb.
max = max % (10 * 1024)

var res Response

Expand All @@ -59,9 +58,8 @@ func FuzzRequestReadLimitBody(f *testing.F) {
f.Add([]byte("POST /a HTTP/1.1\r\nHost: a.com\r\nTransfer-Encoding: chunked\r\nContent-Type: aa\r\n\r\n6\r\nfoobar\r\n3\r\nbaz\r\n0\r\nfoobar\r\n\r\n"), 1024)

f.Fuzz(func(t *testing.T, body []byte, max int) {
if max > 1024*1024 { // Skip limits higher than 1MB.
return
}
// Don't do bodies bigger than 10kb.
max = max % (10 * 1024)

var req Request

Expand Down

0 comments on commit 552e056

Please sign in to comment.