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: ParseForm does not treat missing Content-Type as application/octet-stream #6616
Labels
Milestone
Comments
The code's changed since this was filed but the test program shows the same behaviour. For reference, the section from RFC2616: "Any HTTP/1.1 message containing an entity-body SHOULD include a Content-Type header field defining the media type of that body. If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify the resource. If the media type remains unknown, the recipient SHOULD treat it as type "application/octet-stream"." I don't think a nil error from parsePostForm would be good since there's no case to handle empty Content-Type (http://golang.org/src/pkg/net/http/request.go?#L681) so you would get both nil error and nil Request.PostForm. To treat absent Content-Type as application/octet-stream, a change would need to be made to mime.checkMediaTypeDisposition (or a check made before calling it). The question then is what ParseForm could do with application/octet-stream (probably nothing). So maybe this just requires documenting. (I'm looking at this because of https://golang.org/issue/6334). |
This issue was closed by revision 57e27a8. Status changed to Fixed. |
bz2
added a commit
to bz2/httprequest
that referenced
this issue
Oct 11, 2015
Also includes drive-by fix for test failure on go 1.2 due to test using POST but having no body, and therefor no content-type, which tickles <golang/go#6616>.
bz2
added a commit
to bz2/httprequest
that referenced
this issue
Oct 11, 2015
Also includes drive-by fix for test failure on go 1.2 due to test using POST but having no body, and therefora no content-type, which tickles <golang/go#6616>.
jujubot
added a commit
to juju/httprequest
that referenced
this issue
Oct 12, 2015
Update dependencies to pick up yaml.v2 Also includes drive-by fix for test failure on go 1.2 due to test using POST but having no body, and therefore no content-type, which tickles <golang/go#6616>.
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by john.berthels:
The text was updated successfully, but these errors were encountered: