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: add video/mpeg to DetectContentType #50376

Closed
InfoLibre opened this issue Dec 28, 2021 · 1 comment
Closed

net/http: add video/mpeg to DetectContentType #50376

InfoLibre opened this issue Dec 28, 2021 · 1 comment
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@InfoLibre
Copy link

InfoLibre commented Dec 28, 2021

What is the URL of the page with the issue?

https://pkg.go.dev/net/http#DetectContentType

What is your user agent?

Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0

What did you do?

I used http.DetectContentType with this uploaded MPEG file (unzip it to test):

MOV01A.mpeg.zip

buff, err := file.Open()
head := make([]byte, 512)
_, err = buff.Read(head)
contentType = http.DetectContentType(head)

What did you expect to see?

video/mpeg

What did you see instead?

application/octet-stream (the MIME type of this file isn't recognized)

Could you add this MIME type to http.DetectContentType?

@gopherbot gopherbot added this to the pkgsite/unplanned milestone Dec 28, 2021
@seankhliao seankhliao changed the title x/pkgsite: pkg.go.dev/net/http net/http: add video/mpeg to DetectContentType Dec 28, 2021
@seankhliao seankhliao added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. and removed pkgsite labels Dec 28, 2021
@seankhliao
Copy link
Member

https://mimesniff.spec.whatwg.org/#matching-an-audio-or-video-type-pattern doesn't specify a pattern for video/mpeg

@golang golang locked and limited conversation to collaborators Dec 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants