Skip to content

mime: TypeByExtension returns incorrect value for .webm extension #77701

@jkbcz

Description

@jkbcz

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

$ go version
go version go1.26.0 linux/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE=''
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/home/jakubc/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/home/jakubc/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2514599944=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/home/jakubc/repos/bcc-code/bcc-chat/api/go.mod'
GOMODCACHE='/home/jakubc/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/jakubc/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/home/jakubc/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.26.0.linux-amd64'
GOSUMDB='sum.golang.org'
GOTELEMETRY='on'
GOTELEMETRYDIR='/home/jakubc/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/jakubc/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.26.0.linux-amd64/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.26.0'
GOWORK=''
PKG_CONFIG='pkg-config'
GOROOT/bin/go version: go version go1.26.0 linux/amd64
GOROOT/bin/go tool compile -V: compile version go1.26.0
uname -sr: Linux 6.19.2-2-cachyos
LSB Version:	n/a
Distributor ID:	cachyos
Description:	CachyOS
Release:	rolling
Codename:	n/a
/usr/lib/libc.so.6: GNU C Library (GNU libc) stable release version 2.43.

What did you do?

Checking mime type by extension for .webm extension
mime.TypeByExtension(".webm")

What did you expect to see?

video/webm

What did you see instead?

audio/webm
According to https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/MIME_types/Common_types .webm extension should resolve to video/webm

I would be happy to contribute a fix for this

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.NeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions