diff options
author | phuslu <phus.lu@gmail.com> | 2020-03-13 18:00:44 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-13 11:00:44 +0100 |
commit | b71c8c513c2bd9fb68b471f96294c2045033205b (patch) | |
tree | 48dd518614d36d2d05bb12b60d6059bd1ed754c9 /header_test.go | |
parent | Add LocalAddr to TCPDialer (diff) | |
download | fasthttp-b71c8c513c2bd9fb68b471f96294c2045033205b.tar.gz fasthttp-b71c8c513c2bd9fb68b471f96294c2045033205b.tar.bz2 fasthttp-b71c8c513c2bd9fb68b471f96294c2045033205b.zip |
Add support for `NoDefaultDate` option that excludes the sending of the `Date` header (#758)
Diffstat (limited to 'header_test.go')
-rw-r--r-- | header_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/header_test.go b/header_test.go index 7f84a63..b9b6f46 100644 --- a/header_test.go +++ b/header_test.go @@ -1250,6 +1250,20 @@ func TestResponseContentTypeNoDefaultNotEmpty(t *testing.T) { } } +func TestResponseDateNoDefaultNotEmpty(t *testing.T) { + t.Parallel() + + var h ResponseHeader + + h.noDefaultDate = true + + headers := h.String() + + if strings.Contains(headers, "\r\nDate: ") { + t.Fatalf("ResponseDateNoDefaultNotEmpty fail, response: \n%+v\noutcome: \n%q\n", h, headers) //nolint:govet + } +} + func TestRequestHeaderConnectionClose(t *testing.T) { t.Parallel() |