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: DetectContentType does not detect the mp4 mimetype #8773

Closed
verokarhu opened this issue Sep 18, 2014 · 8 comments
Closed

net/http: DetectContentType does not detect the mp4 mimetype #8773

verokarhu opened this issue Sep 18, 2014 · 8 comments
Labels
FrozenDueToAge Suggested Issues that may be good for new contributors looking for work to do.
Milestone

Comments

@verokarhu
Copy link

What does 'go version' print?
Go 1.3.1

What steps reproduce the problem?

1. Write mp4 data to ResponseWriter

What happened?
The Content-Type header is set to "application/octet-stream"

What should have happened instead?
The Content-Type header is set to "video/mp4"
@ianlancetaylor
Copy link
Contributor

Comment 1:

This is, as it happens, a TODO item in net/http/sniff.go.

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

Status changed to Accepted.

@verokarhu verokarhu added accepted Suggested Issues that may be good for new contributors looking for work to do. labels Sep 18, 2014
@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@Francesco149
Copy link

any plans on implementing this yet? it would help a lot with stuff like file uploading tools that have to detect mime types.

@bradfitz
Copy link
Contributor

/cc @dsymonds

@dsymonds
Copy link
Contributor

Contributions welcome. I'm not planning to do it myself.

@dominikh
Copy link
Member

@dsymonds Any chance to get some input, though? Your todo reads "Re-enable this when the spec is sorted w.r.t. MP4." – Do you, by any chance, remember what had to be sorted? Only the little-endian <-> big-endian issue? I realise this code is 4 years old, so it might be hard to remember.

Also: The current version of the spec only looks for "mp4", not all the other types (iso, M4V, ...) that the original code checks for. How closely should the spec be followed here?

In order to follow the current version of the spec, only a number, and which strings to consider valid, need to be changed.

@dsymonds
Copy link
Contributor

I can't remember. I think at the time the spec didn't actually specify the MP4 string to match, but it looks like it does now. If you add a sniff.go entry for the MP4 string(s) that the spec specifies, that seems fine to me.

@odeke-em
Copy link
Member

@gopherbot
Copy link

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

@golang golang locked and limited conversation to collaborators Nov 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Suggested Issues that may be good for new contributors looking for work to do.
Projects
None yet
Development

No branches or pull requests

9 participants