]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: [Post]FormValue ignores parse errors
authorEvan Shaw <chickencha@gmail.com>
Fri, 27 Jun 2014 18:21:57 +0000 (11:21 -0700)
committerRob Pike <r@golang.org>
Fri, 27 Jun 2014 18:21:57 +0000 (11:21 -0700)
LGTM=r
R=golang-codereviews, bradfitz, r
CC=golang-codereviews
https://golang.org/cl/102640046

src/pkg/net/http/request.go

index a67092066ad2045d23ea66a44f81b3e7d3d36292..80bff9c0ec6c9de6fb41e9a929ca858c17734f22 100644 (file)
@@ -807,7 +807,8 @@ func (r *Request) ParseMultipartForm(maxMemory int64) error {
 
 // FormValue returns the first value for the named component of the query.
 // POST and PUT body parameters take precedence over URL query string values.
-// FormValue calls ParseMultipartForm and ParseForm if necessary.
+// FormValue calls ParseMultipartForm and ParseForm if necessary and ignores
+// any errors returned by these functions.
 // To access multiple values of the same key use ParseForm.
 func (r *Request) FormValue(key string) string {
        if r.Form == nil {
@@ -821,7 +822,8 @@ func (r *Request) FormValue(key string) string {
 
 // PostFormValue returns the first value for the named component of the POST
 // or PUT request body. URL query parameters are ignored.
-// PostFormValue calls ParseMultipartForm and ParseForm if necessary.
+// PostFormValue calls ParseMultipartForm and ParseForm if necessary and ignores
+// any errors returned by these functions.
 func (r *Request) PostFormValue(key string) string {
        if r.PostForm == nil {
                r.ParseMultipartForm(defaultMaxMemory)