]> Cypherpunks repositories - gostls13.git/commit
http: add MaxBytesReader to limit request body size
authorBrad Fitzpatrick <bradfitz@golang.org>
Tue, 23 Aug 2011 08:17:21 +0000 (12:17 +0400)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 23 Aug 2011 08:17:21 +0000 (12:17 +0400)
commitf0ef4f474620ed95a7572c579689f262e79a724f
tree80d2caa7f7067ff1434a8cee500772181ef5fb99
parent6731d47f99d993522aa41990b46498d20ba646f1
http: add MaxBytesReader to limit request body size

This adds http.MaxBytesReader, similar to io.LimitReader,
but specific to http, and for preventing a class of DoS
attacks.

This also makes the 10MB ParseForm limit optional (if
not already set by a MaxBytesReader), documents it,
and also adds "PUT" as a valid verb for parsing forms
in the request body.

Improves issue 2093 (DoS protection)
Fixes #2165 (PUT form parsing)

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4921049
src/pkg/http/request.go
src/pkg/http/serve_test.go
src/pkg/http/server.go
src/pkg/http/transfer.go