]> Cypherpunks repositories - gostls13.git/commit
net/http: bound the number of bytes read seeking EOF in Handler's Body.Close
authorBrad Fitzpatrick <bradfitz@golang.org>
Wed, 24 Jun 2015 09:53:24 +0000 (11:53 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 25 Jun 2015 07:05:07 +0000 (07:05 +0000)
commit1045351cef21a64d954b4477af9f5105ea4287d3
tree52f9111f193136f9f2fe7d2c9260b1af6141dfa5
parent26f12beb5d1828858c365409af23393013c0e4e3
net/http: bound the number of bytes read seeking EOF in Handler's Body.Close

If a client sent a POST with a huge request body, calling
req.Body.Close in the handler (which is implicit at the end of a
request) would end up consuming it all.

Put a cap on that, using the same threshold used elsewhere for similar
cases.

Fixes #9662

Change-Id: I26628413aa5f623a96ef7c2609a8d03c746669e5
Reviewed-on: https://go-review.googlesource.com/11412
Reviewed-by: Andrew Gerrand <adg@golang.org>
src/net/http/request.go
src/net/http/serve_test.go
src/net/http/server.go
src/net/http/transfer.go