From: Evan Shaw Date: Fri, 27 Jun 2014 18:21:57 +0000 (-0700) Subject: net/http: [Post]FormValue ignores parse errors X-Git-Tag: go1.4beta1~1208 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=128eed2749fa1bc38b3b605c9749441a009ac791;p=gostls13.git net/http: [Post]FormValue ignores parse errors LGTM=r R=golang-codereviews, bradfitz, r CC=golang-codereviews https://golang.org/cl/102640046 --- diff --git a/src/pkg/net/http/request.go b/src/pkg/net/http/request.go index a67092066a..80bff9c0ec 100644 --- a/src/pkg/net/http/request.go +++ b/src/pkg/net/http/request.go @@ -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)