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 application/x-bzip2 #32508

Closed
coreydaley opened this issue Jun 9, 2019 · 5 comments
Closed

net/http: DetectContentType does not detect application/x-bzip2 #32508

coreydaley opened this issue Jun 9, 2019 · 5 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@coreydaley
Copy link

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

$ go version
go version go1.12.5 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
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/cdaley/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/cdaley/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/golang"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/cdaley/Projects/github.com/offlinedocs/offlinedocs/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build110412641=/tmp/go-build -gno-record-gcc-switches"GOARCH="amd64"
GOBIN=""
GOCACHE="/home/cdaley/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/cdaley/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/golang"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/cdaley/Projects/github.com/offlinedocs/offlinedocs/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build110412641=/tmp/go-build -gno-record-gcc-switches"

What did you do?

extracted the first 512 bytes of a bzip2 file and ran net/http.DetectContentType on it
https://play.golang.org/p/u4WBPl0bsMS

What did you expect to see?

application/x-bzip2

What did you see instead?

application/octet-stream

@gopherbot
Copy link

Change https://golang.org/cl/181420 mentions this issue: net/http: add application/x-bzip2 detection to DetectContentType

@odeke-em odeke-em changed the title net/http.DetectContentType does not detect application/x-bzip2 net/http: DetectContentType does not detect application/x-bzip2 Jun 9, 2019
@odeke-em
Copy link
Member

odeke-em commented Jun 9, 2019

Thank you for filing this issue @coreydaley!

So we get the signatures from https://mimesniff.spec.whatwg.org/#zip-based-mime-type so perhaps let's first file an issue on the Github issues https://github.com/whatwg/mimesniff and once that's agreed upon we'll LGTM your CL. Thank you.

@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 9, 2019
@dmitshur dmitshur added this to the Go1.14 milestone Jun 9, 2019
@odeke-em
Copy link
Member

I am going to move this to the unreleased milestone since we are depending on browsers and the MIME working group to approve the signatures.

@odeke-em odeke-em modified the milestones: Go1.14, Unreleased Sep 26, 2019
@bradfitz bradfitz modified the milestones: Unreleased, Unplanned Oct 14, 2019
@bradfitz
Copy link
Contributor

@odeke-em, Unreleased is for code that's not included in Go releases. I changed to Unplanned. We can do this if the upstream spec is updated.

@odeke-em
Copy link
Member

odeke-em commented Oct 14, 2019 via email

@golang golang locked and limited conversation to collaborators Apr 3, 2024
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

Successfully merging a pull request may close this issue.

5 participants