]> Cypherpunks repositories - gostls13.git/commit
net/url: preserve leading slashes when resolving path
authorMark Theunissen <mark.theunissen@gmail.com>
Tue, 25 Jul 2017 10:47:39 +0000 (12:47 +0200)
committerRuss Cox <rsc@golang.org>
Mon, 30 Oct 2017 21:00:06 +0000 (21:00 +0000)
commit84e91e1d6b2fed3e19d69194067cc2797f503b95
treee54690049b9b52630e606d0c14cc2b05b080ddf0
parentb4c3fe7b049f79f81fae52d5006aa29b926bb4e0
net/url: preserve leading slashes when resolving path

When doing resolvePath, if there are multiple leading slashes in the
target, preserve them. This prevents an issue where the Go http.Client
cleans up multiple leading slashes in the Location header in a
redirect, resulting in a redirection to the incorrect target.

Fixes #21158.

Change-Id: I6a21ea61ca3bc7033f3c8a6ccc21ecaa3e996fa8
Reviewed-on: https://go-review.googlesource.com/51050
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
src/net/url/url.go
src/net/url/url_test.go