aboutsummaryrefslogtreecommitdiff
path: root/uri_test.go
diff options
context:
space:
mode:
authorGravatar Erik Dubbelboer <erik@dubbelboer.com> 2019-12-01 09:44:21 +0100
committerGravatar GitHub <noreply@github.com> 2019-12-01 09:44:21 +0100
commit6cccaebf64c62d314fb0fe70b36d24542541bf5c (patch)
tree4478ed218f6437cc4ea04ed4be839d7ce4deb0a9 /uri_test.go
parentAllow a body for GET requests (#703) (diff)
downloadfasthttp-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.go6
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,