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: the default Director created by NewSingleHostReverseProxy can't pass through %2F when target path is non-root #28359

Open
SamLex opened this issue Oct 24, 2018 · 1 comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@SamLex
Copy link

SamLex commented Oct 24, 2018

Same as #9589, but narrowed to when the target has a non-root path.

What did you do?

https://play.golang.org/p/aVfpA4qDvBD
Updated to use httptest.NewRequest: https://play.golang.org/p/IaxyHIn-iDd

What did you expect to see?

GET /subpath/SOME%2FPATH HTTP/1.1
Host: example.com
Accept-Encoding: gzip

What did you see instead?

GET /subpath/SOME/PATH HTTP/1.1
Host: example.com
Accept-Encoding: gzip

System details

go version go1.11.1 linux/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/euan/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/euan/Go"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/go"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
GOROOT/bin/go version: go version go1.11.1 linux/amd64
GOROOT/bin/go tool compile -V: compile version go1.11.1
uname -sr: Linux 4.18.12-arch1-1-ARCH
/usr/lib/libc.so.6: GNU C Library (GNU libc) stable release version 2.28.
gdb --version: GNU gdb (GDB) 8.2

Workaround

Wrap Director to also modify RawURL: https://play.golang.org/p/akfhd7Qsemm
Updated as well: https://play.golang.org/p/ydw6fN3wU-l

@bcmills
Copy link
Contributor

bcmills commented Oct 24, 2018

CC @bradfitz

@bcmills bcmills added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 24, 2018
@bcmills bcmills added this to the Unplanned milestone Oct 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

2 participants