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 redirection to wrong path #26396

Closed
labkode opened this issue Jul 16, 2018 · 0 comments
Closed

net/http/httputil redirection to wrong path #26396

labkode opened this issue Jul 16, 2018 · 0 comments

Comments

@labkode
Copy link

labkode commented Jul 16, 2018

This issue can be related to "net/http" and not just to "net/http/httputil", depends where the redirection logic is contained.

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

go version go1.10 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/labkode/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/labkode/go/"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
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/labkode/go-build124504389=/tmp/go-build -gno-record-gcc-switches"

What did you do?

When using the reverse proxy from "net/http/httputil", non normalized urls (containing a dot character) get a redirection to a wrong path that that starts with /@/

ip  - - [16/Jul/2018:14:21:17 +0200] "GET /cernbox/doc/Linux/repo/Ubuntu_18.04/./amd64/ocqt562%2b240-libqt5core5a_5.6.2-14%2b6.17_amd64.deb HTTP/1.1" 301 128
ip  - - [16/Jul/2018:14:21:17 +0200] "GET /@/cernbox/doc/Linux/repo/Ubuntu_18.04/amd64/ocqt562+240-libqt5core5a_5.6.2-14+6.17_amd64.deb HTTP/1.1" 404 290

What did you expect to see?

When the url is normalized by removing the dot character (.) before amd64, the request is fine.

ip  - - [16/Jul/2018:14:28:40 +0200] "GET /cernbox/doc/Linux/repo/Ubuntu_18.04/amd64/ocqt562%2b240-libqt5core5a_5.6.2-14%2b6.17_amd64.deb HTTP/1.1" 200 1831744

What did you see instead?

301 redirection to wrong place

@labkode labkode closed this as completed Jul 16, 2018
@golang golang locked and limited conversation to collaborators Jul 16, 2019
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

2 participants