]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: document that ParseForm consumes Request.Body
authorLuka Zitnik <luka.zitnik@gmail.com>
Tue, 24 Dec 2019 00:08:11 +0000 (01:08 +0100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 8 Jan 2020 15:48:04 +0000 (15:48 +0000)
Fixes #35620

Change-Id: I71bc56ec7a7507d14b4f013177b4b816bb1a2094
Reviewed-on: https://go-review.googlesource.com/c/go/+/212458
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/http/request.go

index 8dd9fe199f40c321771a43d62f789e2124f3b761..88fa0939f246e365b5fc2b65465f6b53d4463f50 100644 (file)
@@ -1223,17 +1223,17 @@ func parsePostForm(r *Request) (vs url.Values, err error) {
 // For all requests, ParseForm parses the raw query from the URL and updates
 // r.Form.
 //
-// For POST, PUT, and PATCH requests, it also parses the request body as a form
-// and puts the results into both r.PostForm and r.Form. Request body parameters
-// take precedence over URL query string values in r.Form.
+// For POST, PUT, and PATCH requests, it also reads the request body, parses it
+// as a form and puts the results into both r.PostForm and r.Form. Request body
+// parameters take precedence over URL query string values in r.Form.
+//
+// If the request Body's size has not already been limited by MaxBytesReader,
+// the size is capped at 10MB.
 //
 // For other HTTP methods, or when the Content-Type is not
 // application/x-www-form-urlencoded, the request Body is not read, and
 // r.PostForm is initialized to a non-nil, empty value.
 //
-// If the request Body's size has not already been limited by MaxBytesReader,
-// the size is capped at 10MB.
-//
 // ParseMultipartForm calls ParseForm automatically.
 // ParseForm is idempotent.
 func (r *Request) ParseForm() error {