aboutsummaryrefslogtreecommitdiff
path: root/uri_test.go
diff options
context:
space:
mode:
authorGravatar Aliaksandr Valialkin <valyala@gmail.com> 2017-11-08 13:05:29 +0200
committerGravatar Aliaksandr Valialkin <valyala@gmail.com> 2017-11-08 13:05:29 +0200
commite2ac397815808b48a6f634b82e6b96bec382dadb (patch)
tree97fd799016c9f5a6cd30cb91747319d37e8bb17c /uri_test.go
parentAdded RequestCtx.String that returns unique string representation of the requ... (diff)
downloadfasthttp-e2ac397815808b48a6f634b82e6b96bec382dadb.tar.gz
fasthttp-e2ac397815808b48a6f634b82e6b96bec382dadb.tar.bz2
fasthttp-e2ac397815808b48a6f634b82e6b96bec382dadb.zip
Parse bogus uris with missing slash after hostname like `http://foobar.com?baz=123`, since such uris occur in real life :(
Diffstat (limited to 'uri_test.go')
-rw-r--r--uri_test.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/uri_test.go b/uri_test.go
index c10d21b..beb4f7d 100644
--- a/uri_test.go
+++ b/uri_test.go
@@ -235,6 +235,9 @@ func TestURIParseNilHost(t *testing.T) {
testURIParseScheme(t, "//google.com/foobar", "http", "google.com", "/foobar")
testURIParseScheme(t, "fTP://aaa.com", "ftp", "aaa.com", "/")
testURIParseScheme(t, "httPS://aaa.com", "https", "aaa.com", "/")
+
+ // missing slash after hostname
+ testURIParseScheme(t, "http://foobar.com?baz=111", "http", "foobar.com", "/?baz=111")
}
func testURIParseScheme(t *testing.T, uri, expectedScheme, expectedHost, expectedRequestURI string) {