From 128eed2749fa1bc38b3b605c9749441a009ac791 Mon Sep 17 00:00:00 2001 From: Evan Shaw Date: Fri, 27 Jun 2014 11:21:57 -0700 Subject: [PATCH] net/http: [Post]FormValue ignores parse errors LGTM=r R=golang-codereviews, bradfitz, r CC=golang-codereviews https://golang.org/cl/102640046 --- src/pkg/net/http/request.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) -- 2.48.1