aboutsummaryrefslogtreecommitdiff
path: root/fasthttpadaptor
diff options
context:
space:
mode:
authorGravatar Erik Dubbelboer <erik@dubbelboer.com> 2021-06-01 10:52:35 +0200
committerGravatar GitHub <noreply@github.com> 2021-06-01 10:52:35 +0200
commit6233fbc08ea58da4f846ae3c4fd4bfd6feabb55b (patch)
tree24fed41f540293ed7f2d52105bcfe5da282530fd /fasthttpadaptor
parentRemove unused peekRawHeader (diff)
downloadfasthttp-6233fbc08ea58da4f846ae3c4fd4bfd6feabb55b.tar.gz
fasthttp-6233fbc08ea58da4f846ae3c4fd4bfd6feabb55b.tar.bz2
fasthttp-6233fbc08ea58da4f846ae3c4fd4bfd6feabb55b.zip
Fix header .Add functions (#1036)v1.26.0
These functions should take the headers that are handled differently into account.
Diffstat (limited to 'fasthttpadaptor')
-rw-r--r--fasthttpadaptor/adaptor_test.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/fasthttpadaptor/adaptor_test.go b/fasthttpadaptor/adaptor_test.go
index f98d090..e252f39 100644
--- a/fasthttpadaptor/adaptor_test.go
+++ b/fasthttpadaptor/adaptor_test.go
@@ -20,7 +20,6 @@ func TestNewFastHTTPHandler(t *testing.T) {
expectedRequestURI := "/foo/bar?baz=123"
expectedBody := "body 123 foo bar baz"
expectedContentLength := len(expectedBody)
- expectedTransferEncoding := "encoding"
expectedHost := "foobar.com"
expectedRemoteAddr := "1.2.3.4:6789"
expectedHeader := map[string]string{
@@ -56,8 +55,8 @@ func TestNewFastHTTPHandler(t *testing.T) {
if r.ContentLength != int64(expectedContentLength) {
t.Fatalf("unexpected contentLength %d. Expecting %d", r.ContentLength, expectedContentLength)
}
- if len(r.TransferEncoding) != 1 || r.TransferEncoding[0] != expectedTransferEncoding {
- t.Fatalf("unexpected transferEncoding %q. Expecting %q", r.TransferEncoding, expectedTransferEncoding)
+ if len(r.TransferEncoding) != 0 {
+ t.Fatalf("unexpected transferEncoding %q. Expecting []", r.TransferEncoding)
}
if r.Host != expectedHost {
t.Fatalf("unexpected host %q. Expecting %q", r.Host, expectedHost)
@@ -101,7 +100,6 @@ func TestNewFastHTTPHandler(t *testing.T) {
req.Header.SetMethod(expectedMethod)
req.SetRequestURI(expectedRequestURI)
req.Header.SetHost(expectedHost)
- req.Header.Add(fasthttp.HeaderTransferEncoding, expectedTransferEncoding)
req.BodyWriter().Write([]byte(expectedBody)) // nolint:errcheck
for k, v := range expectedHeader {
req.Header.Set(k, v)