net/http: r.FormValue()
ignores the return value of ParseMultipartForm()
#20895
Labels
r.FormValue()
ignores the return value of ParseMultipartForm()
#20895
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.8.1 darwin/amd64
What operating system and processor architecture are you using (
go env
)?What did you do?
I have a Go Http endpoint that handles image uploads. From the client I make a POST request, with a content type
multipart/form-data
. I send some string key, value pairs and an image file.On the server when I try to read the string values sent using
request.FormValue("key_name")
I get an empty string. This is the source code ofrequest.FormValue
fromnet/http
:The return value of
ParseMultipartForm
is ignored. It is theParseMultipartForm
function which is failing. Why is the return value ignored?What did you expect to see?
The error returned from
ParseMultipartForm
should have been handled inrequest.FormValue
of the net/http packageWhat did you see instead?
The error returned from
ParseMultipartForm
is not handled.The text was updated successfully, but these errors were encountered: