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-tar #32505

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

net/http: DetectContentType does not detect application/x-tar #32505

coreydaley opened this issue Jun 9, 2019 · 4 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 tar file and ran net/http.DetectContentType on it
https://play.golang.org/p/6K9ve_L54ua

What did you expect to see?

application/x-tar

What did you see instead?

application/octet-stream

@gopherbot
Copy link

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

@dmitshur dmitshur changed the title /net/http.DetectContentType does not detect application/x-tar net/http: DetectContentType does not detect application/x-tar Jun 9, 2019
@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

odeke-em commented Jun 9, 2019

Just like in #32508 (comment), we get the signatures from https://mimesniff.spec.whatwg.org/ 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 review your CL @coreydaley.

@coreydaley
Copy link
Author

@odeke-em thanks, created whatwg/mimesniff#105

@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
@odeke-em odeke-em modified the milestones: Unreleased, Unplanned Oct 15, 2019
@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.

4 participants