diff options
author | Aliaksandr Valialkin <valyala@gmail.com> | 2015-11-19 15:05:27 +0200 |
---|---|---|
committer | Aliaksandr Valialkin <valyala@gmail.com> | 2015-11-19 15:05:27 +0200 |
commit | 2b1eca3a705c8da5e17472ddcb94ac335bdbf8bd (patch) | |
tree | 7b32d90bb3b047e3ae6ff06c5d4bddb91df583c3 /uri_test.go | |
parent | Added Stringer implementations to URI, Args and Cookie (diff) | |
download | fasthttp-2b1eca3a705c8da5e17472ddcb94ac335bdbf8bd.tar.gz fasthttp-2b1eca3a705c8da5e17472ddcb94ac335bdbf8bd.tar.bz2 fasthttp-2b1eca3a705c8da5e17472ddcb94ac335bdbf8bd.zip |
Optimize request uri parsing - defer Host header reading
Diffstat (limited to 'uri_test.go')
-rw-r--r-- | uri_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/uri_test.go b/uri_test.go index bb2527a..ff9c6b1 100644 --- a/uri_test.go +++ b/uri_test.go @@ -88,7 +88,7 @@ func testURIFullURI(t *testing.T, scheme, host, path, hash string, args *Args, e var u URI u.Scheme = []byte(scheme) - u.Host = []byte(host) + u.host = []byte(host) u.Path = []byte(path) u.Hash = []byte(hash) args.CopyTo(u.QueryArgs()) @@ -164,8 +164,8 @@ func testURIParse(t *testing.T, u *URI, host, uri, if !bytes.Equal(u.FullURI(), []byte(expectedURI)) { t.Fatalf("Unexpected uri %q. Expected %q. host=%q, uri=%q", u.FullURI(), expectedURI, host, uri) } - if !bytes.Equal(u.Host, []byte(expectedHost)) { - t.Fatalf("Unexpected host %q. Expected %q. host=%q, uri=%q", u.Host, expectedHost, host, uri) + if !bytes.Equal(u.Host(), []byte(expectedHost)) { + t.Fatalf("Unexpected host %q. Expected %q. host=%q, uri=%q", u.Host(), expectedHost, host, uri) } if !bytes.Equal(u.PathOriginal, []byte(expectedPathOriginal)) { t.Fatalf("Unexpected original path %q. Expected %q. host=%q, uri=%q", u.PathOriginal, expectedPathOriginal, host, uri) |