diff options
author | Erik Dubbelboer <erik@dubbelboer.com> | 2021-05-26 09:09:34 +0200 |
---|---|---|
committer | Erik Dubbelboer <erik@dubbelboer.com> | 2021-05-26 09:09:50 +0200 |
commit | 5bb5cfc9ca3db7caf1917ca0c8431e70cafa87cb (patch) | |
tree | dbd7a772003548c760484559a1b48a59a2ed2ee7 /header_test.go | |
parent | Add Request.TLS and try to avoid a new alloc if Request.Header is already all... (diff) | |
download | fasthttp-5bb5cfc9ca3db7caf1917ca0c8431e70cafa87cb.tar.gz fasthttp-5bb5cfc9ca3db7caf1917ca0c8431e70cafa87cb.tar.bz2 fasthttp-5bb5cfc9ca3db7caf1917ca0c8431e70cafa87cb.zip |
Remove unused peekRawHeader
Diffstat (limited to 'header_test.go')
-rw-r--r-- | header_test.go | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/header_test.go b/header_test.go index 0f7c7f8..354ebb4 100644 --- a/header_test.go +++ b/header_test.go @@ -1054,35 +1054,6 @@ func TestRequestHeaderProxyWithCookie(t *testing.T) { } } -func TestPeekRawHeader(t *testing.T) { - t.Parallel() - - // empty header - testPeekRawHeader(t, "", "Foo-Bar", "") - - // different case - testPeekRawHeader(t, "Content-Length: 3443\r\n", "content-length", "") - - // no trailing crlf - testPeekRawHeader(t, "Content-Length: 234", "Content-Length", "") - - // single header - testPeekRawHeader(t, "Content-Length: 12345\r\n", "Content-Length", "12345") - - // multiple headers - testPeekRawHeader(t, "Host: foobar\r\nContent-Length: 434\r\nFoo: bar\r\n\r\n", "Content-Length", "434") - - // lf without cr - testPeekRawHeader(t, "Foo: bar\nConnection: close\nAaa: bbb\ncc: ddd\n", "Connection", "close") -} - -func testPeekRawHeader(t *testing.T, rawHeaders, key string, expectedValue string) { - v := peekRawHeader([]byte(rawHeaders), []byte(key)) - if string(v) != expectedValue { - t.Fatalf("unexpected raw headers value %q. Expected %q. key %q, rawHeaders %q", v, expectedValue, key, rawHeaders) - } -} - func TestResponseHeaderFirstByteReadEOF(t *testing.T) { t.Parallel() |