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

mime: TypeByExtension is case sensitive #8350

Closed
reusee opened this issue Jul 9, 2014 · 8 comments
Closed

mime: TypeByExtension is case sensitive #8350

reusee opened this issue Jul 9, 2014 · 8 comments

Comments

@reusee
Copy link

reusee commented Jul 9, 2014

What does 'go version' print?
go version devel +a5e45f250654 Wed Jul 09 13:17:27 2014 +1000 linux/amd64

What steps reproduce the problem?
http://play.golang.org/p/hYEP_A3Ie9

What happened?
"type: "

What should have happened instead?
"type: image/jpeg"
@jeffallen
Copy link
Contributor

Comment 1:

I understand this request and I agree in principle. But when I looked for a
specification saying these should be case insensitive, I could not find it. Can you
point out one?

@davecheney
Copy link
Contributor

Comment 2:

rfc2045:
"   The type, subtype, and parameter names are not case sensitive.  For
   example, TEXT, Text, and TeXt are all equivalent top-level media
   types.  Parameter values are normally case sensitive, but sometimes
   are interpreted in a case-insensitive fashion, depending on the
   intended use.  (For example, multipart boundaries are case-sensitive,
   but the "access-type" parameter for message/External-body is not
   case-sensitive.)
The rest of the rfc details in the bnf grammar which comparisons are case sensitive and
which are not.

Labels changed: added release-none, repo-main.

Status changed to Accepted.

@bradfitz
Copy link
Contributor

Comment 3:

That's talking about the case sensitivity of mime types, not file extensions, no?

@davecheney
Copy link
Contributor

Comment 4:

I am sorry, I mistook this issue for one about mime type case sensitivity.

@reusee
Copy link
Author

reusee commented Aug 14, 2014

Comment 5:

File extension is not strictly defined in any specification but in some other
widely-used language / platform it's case insensitive.
apache http://httpd.apache.org/docs/current/mod/mod_mime.html "The extension argument is
case-insensitive"
python https://docs.python.org/2/library/mimetypes.html "type suffixes are first tried
case sensitively, then case insensitively"

@gopherbot
Copy link

Comment 6:

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

@bradfitz
Copy link
Contributor

Comment 7:

If anything, I think we should do what Python does in comment #5. That doesn't appear to
be what Patchset 3 of https://golang.org/cl/127380043 implements.

@bradfitz
Copy link
Contributor

Comment 8:

This issue was closed by revision af12dc5.

Status changed to Fixed.

@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#8350.

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

LGTM=bradfitz
R=golang-codereviews, bradfitz, dave
CC=golang-codereviews
https://golang.org/cl/127380043
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

5 participants