Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http: document that ParseMultipartForm requires Content-Type: multipart/form-data as of Go 1.3 #8403

Closed
gopherbot opened this issue Jul 21, 2014 · 10 comments

Comments

@gopherbot
Copy link

by dgrijalva@fitstar.com:

Prior to go1.3, calling ParseMultipartForm on a http.Request that did not have the
content type 'multipart/form-data' would silently just do the right thing.  As of 1.3,
an error is returned that looks like 'request Content-Type isn't multipart/form-data'. 
I couldn't find this behavior change anywhere in the release notes.

This different behavior seems logical, although less convenient for my use case.  What
strikes me as unusual is that it's not totally backwards compatible and there doesn't
seem to be mention of in the release notes.  Was this an intentional change or an
oversight?  Will it be changed back or should I work around it?
@bradfitz
Copy link
Contributor

Comment 1:

This was a result of issue #6334 being fixed.
I was paranoid in the review (e.g. https://golang.org/cl/44040043#msg10) but
apparently not enough.
It probably should've been documented. I don't think changing it back at this point
makes sense, though.
I suppose we could amend the Go 1.3 release notes in Go 1.3.1 so at least people hitting
this (you're the first?) know what [not] to do.

Labels changed: added release-go1.3.1.

Status changed to Thinking.

@gopherbot
Copy link
Author

Comment 2 by dgrijalva@fitstar.com:

I would likely not have run into this if I were building something new.  The
documentation doesn't say what will happen in this case, and one solution feels as good
as the other to me.  Code based on the old behavior will likely often be wrong.  It
would be nice if the documentation and/or release notes reflected the change.
Just for the sake of clarity: the code I'm working with assumed that an error meant the
whole request was bad (protocol/network error, etc) and bail out completely.  If there
was no error, it would check properties on the request to figure out what had actually
happened.

@rsc
Copy link
Contributor

rsc commented Aug 6, 2014

Comment 3:

Brad, can you take care of updating the release notes?

Owner changed to @bradfitz.

@adg
Copy link
Contributor

adg commented Aug 7, 2014

Comment 4:

https://golang.org/cl/123860043

Owner changed to @adg.

Status changed to Started.

@gopherbot
Copy link
Author

Comment 5:

CL https://golang.org/cl/123860043 mentions this issue.

@adg
Copy link
Contributor

adg commented Aug 7, 2014

Comment 6:

This issue was closed by revision af403c0.

Status changed to Fixed.

@rsc
Copy link
Contributor

rsc commented Aug 11, 2014

Comment 7:

Doc-only change.
Approved for Go 1.3.1.

@gopherbot
Copy link
Author

Comment 8 by dgrijalva@fitstar.com:

<3

@adg
Copy link
Contributor

adg commented Aug 11, 2014

Comment 9:

This issue was closed by revision 1f7b50bf1050.

@adg
Copy link
Contributor

adg commented Aug 11, 2014

Comment 10:

Applied to release-branch.go1.3.

@rsc rsc added this to the Go1.3.1 milestone Apr 14, 2015
adg added a commit that referenced this issue May 11, 2015
««« CL 123860043 / cf99a05f0fbc
doc: document new ParseMultipartForm behavior

Fixes #8403.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/123860043
»»»

TBR=rsc
CC=golang-codereviews
https://golang.org/cl/127070043
@golang golang locked and limited conversation to collaborators Jun 25, 2016
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jun 25, 2018
Fixes golang#8403.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/123860043
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jul 9, 2018
Fixes golang#8403.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/123860043
@rsc rsc unassigned adg Jun 23, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants