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/httputil: dumps CONNECT httpRequest not correctly #37858

Closed
amanenk opened this issue Mar 14, 2020 · 2 comments
Closed

net/http/httputil: dumps CONNECT httpRequest not correctly #37858

amanenk opened this issue Mar 14, 2020 · 2 comments

Comments

@amanenk
Copy link

amanenk commented Mar 14, 2020

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

$ go version
go version go1.14 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
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/andrii/.cache/go-build"
GOENV="/home/andrii/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY="gitlab.com"
GONOSUMDB="gitlab.com"
GOOS="linux"
GOPATH="/home/andrii/go"
GOPRIVATE="gitlab.com"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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-build663872885=/tmp/go-build -gno-record-gcc-switches"

What did you do?

here is example of code

What did you expect to see?

output should be:

dump request
CONNECT google.com:80 HTTP/1.1
Host: google.com:80

What did you see instead?

I see:

dump request
CONNECT / HTTP/1.1
Host: google.com:80
@seankhliao
Copy link
Member

client requests should use DumpRequestOut https://golang.org/pkg/net/http/httputil/#DumpRequestOut

@cagedmantis cagedmantis changed the title net/http/httputil dumps CONNECT httpRequest not correctly net/http/httputil: dumps CONNECT httpRequest not correctly Mar 16, 2020
@cagedmantis
Copy link
Contributor

@seankhliao is correct. Client requests should use DumpRequestOut as noted in the documentation linked above. This is working as intended.

@golang golang locked and limited conversation to collaborators Mar 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants