1
0
mirror of https://github.com/golang/go synced 2024-11-18 02:14:45 -07:00

net/url: add tests for RequestURI returning //paths

Fixes #10433.

Change-Id: I2a8b54e3f07488f204b1d14eb2603842caaf1e5a
Reviewed-on: https://go-review.googlesource.com/17386
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Russ Cox 2015-12-04 12:28:15 -05:00
parent 4f97ec0866
commit 503cbcef70

View File

@ -511,6 +511,16 @@ var urltests = []URLTest{
},
"",
},
// golang.org/issue/10433 (path beginning with //)
{
"http://example.com//foo",
&URL{
Scheme: "http",
Host: "example.com",
Path: "//foo",
},
"",
},
}
// more useful string for debugging than fmt's struct printer
@ -1178,6 +1188,14 @@ var requritests = []RequestURITest{
},
"opaque?q=go+language",
},
{
&URL{
Scheme: "http",
Host: "example.com",
Path: "//foo",
},
"//foo",
},
}
func TestRequestURI(t *testing.T) {