diff options
author | Aliaksandr Valialkin <valyala@gmail.com> | 2017-11-08 13:05:29 +0200 |
---|---|---|
committer | Aliaksandr Valialkin <valyala@gmail.com> | 2017-11-08 13:05:29 +0200 |
commit | e2ac397815808b48a6f634b82e6b96bec382dadb (patch) | |
tree | 97fd799016c9f5a6cd30cb91747319d37e8bb17c /uri_test.go | |
parent | Added RequestCtx.String that returns unique string representation of the requ... (diff) | |
download | fasthttp-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.go | 3 |
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) { |