diff options
author | Dmitri Shuralyov <dmitshur@golang.org> | 2019-06-04 21:21:33 +0000 |
---|---|---|
committer | Dmitri Shuralyov <dmitshur@golang.org> | 2019-06-04 22:36:51 +0000 |
commit | 003dbc4cda6a1418fc419461799320521d64f4e5 (patch) | |
tree | acd01a9a2ce416c3ede709fe25c33580cb59407e /src/net/http/serve_test.go | |
parent | 27eaffc053d77e967c8bcd71b47087f468accb46 (diff) | |
download | go-003dbc4cda6a1418fc419461799320521d64f4e5.tar.gz go-003dbc4cda6a1418fc419461799320521d64f4e5.zip |
net/http: roll back "clean the path of the stripped URL by StripPrefix"
Roll back CL 161738. That fix changed StripPrefix behavior in the
general case, not just in the situation where where stripping the
prefix from path resulted in the empty string, causing issue #31622.
That kind of change to StripPrefix behavior is not backwards compatible,
and there can be a smaller, more targeted fix for the original issue.
Fixes #31622
Updates #30165
Change-Id: Ie2fcfe6787a32e44f71d564d8f9c9d580fc6f704
Reviewed-on: https://go-review.googlesource.com/c/go/+/180498
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/net/http/serve_test.go')
-rw-r--r-- | src/net/http/serve_test.go | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/src/net/http/serve_test.go b/src/net/http/serve_test.go index 1c67b40161..679936e115 100644 --- a/src/net/http/serve_test.go +++ b/src/net/http/serve_test.go @@ -2900,15 +2900,6 @@ func TestStripPrefix(t *testing.T) { t.Errorf("test 2: got status %v, want %v", g, e) } res.Body.Close() - - res, err = c.Get(ts.URL + "/foo") - if err != nil { - t.Fatal(err) - } - if g, e := res.Header.Get("X-Path"), "/"; g != e { - t.Errorf("test 3: got %s, want %s", g, e) - } - res.Body.Close() } // https://golang.org/issue/18952. |