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: incorrect definition of extension by mime type audio/webm #22318

Closed
sintanial opened this issue Oct 18, 2017 · 2 comments
Closed

mime: incorrect definition of extension by mime type audio/webm #22318

sintanial opened this issue Oct 18, 2017 · 2 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@sintanial
Copy link

sintanial commented Oct 18, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.9.1 linux/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build626851427=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

What did you do?

Call mime.ExtensionsByType("audio/webm") return empty result. It's reproduced only on linux (i tested it only on ubuntu 16.04). This problem occurs because there in no corresponding entry for audio/webm in /etc/mime.types.
I don't know it's golang bug or not, but it's crashed all my service yesterday :). I think mime.ExtensionsByType must return same result on different OS ?

What did you expect to see?

Expect to return slice [.weba]

What did you see instead?

Empty result

@ALTree ALTree added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 18, 2017
@ianlancetaylor
Copy link
Contributor

For functions like ExtensionsByType the mime package has to defer to the operating system. There is no reasonable way for us to provide the information for every MIME type for every operating system, because there is no standard for us to follow. At least, there is no standard that is going to help for a new MIME type like audio/webm. In this case you suggest that it should return ".weba" but looking around on the net shows that some systems use ".webm" instead.

Closing because I don't think there is anything we can do in the Go standard library.

@sintanial
Copy link
Author

ok, thx for answer

@golang golang locked and limited conversation to collaborators Oct 19, 2018
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

4 participants