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: Host Header must not be deleted from http.Request.Header #66454

Closed
torikki-tou opened this issue Mar 21, 2024 · 2 comments
Closed

net/http: Host Header must not be deleted from http.Request.Header #66454

torikki-tou opened this issue Mar 21, 2024 · 2 comments

Comments

@torikki-tou
Copy link

Go version

go version go1.22.0 darwin/arm64

Output of go env in your module/workspace:

GO111MODULE='on'
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/torikki/Library/Caches/go-build'
GOENV='/Users/torikki/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/torikki/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/torikki/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/Users/torikki/sdk/go1.22.0'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/torikki/sdk/go1.22.0/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.22.0'
GCCGO='gccgo'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/Users/torikki/GolandProjects/connection-watcher/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/xz/tlwsgxjj4tl8s8v729j6w74w0000gn/T/go-build1614244256=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

I wanted to get Host header directly from http.Request.Header but eventually found out that it is accessible only from http.Request.Host. Why is that? Would be nice to have strait access

What did you see happen?

Host header accessible only from http.Request.Host where it might be mixed with data from URL or HTTP/2 :authority header. I need Host header unchanged

What did you expect to see?

Get Host header accessible from http.Request.Header

@seankhliao
Copy link
Member

Duplicate of #13134

@seankhliao seankhliao marked this as a duplicate of #13134 Mar 21, 2024
@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Mar 21, 2024
@torikki-tou
Copy link
Author

@seankhliao I strongly disagree with what @bradfitz said there, but issue is frozen. I don't think not removing Host header (e.g. adding it) is an incompatible change. Even if it is, we could discuss adding some kind of optional parameter for that.

We have to at least agree that mandatory removal something from headers is not a good thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants