diff options
author | Erik Dubbelboer <erik@dubbelboer.com> | 2019-12-01 09:44:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-01 09:44:21 +0100 |
commit | 6cccaebf64c62d314fb0fe70b36d24542541bf5c (patch) | |
tree | 4478ed218f6437cc4ea04ed4be839d7ce4deb0a9 /uri_test.go | |
parent | Allow a body for GET requests (#703) (diff) | |
download | fasthttp-6cccaebf64c62d314fb0fe70b36d24542541bf5c.tar.gz fasthttp-6cccaebf64c62d314fb0fe70b36d24542541bf5c.tar.bz2 fasthttp-6cccaebf64c62d314fb0fe70b36d24542541bf5c.zip |
Fix parsing relative URLs starting with // (#702)
* Fix parsing relative URLs starting with //
* Improve test
Diffstat (limited to 'uri_test.go')
-rw-r--r-- | uri_test.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/uri_test.go b/uri_test.go index c90b4e1..06d7526 100644 --- a/uri_test.go +++ b/uri_test.go @@ -345,6 +345,12 @@ func TestURIParse(t *testing.T) { // http:// in query params testURIParse(t, &u, "aaa.com", "/foo?bar=http://google.com", "http://aaa.com/foo?bar=http://google.com", "aaa.com", "/foo", "/foo", "bar=http://google.com", "") + + testURIParse(t, &u, "aaa.com", "//relative", + "http://aaa.com/relative", "aaa.com", "/relative", "//relative", "", "") + + testURIParse(t, &u, "", "//aaa.com//absolute", + "http://aaa.com/absolute", "aaa.com", "/absolute", "//absolute", "", "") } func testURIParse(t *testing.T, u *URI, host, uri, |