aboutsummaryrefslogtreecommitdiff
path: root/header_test.go
diff options
context:
space:
mode:
authorGravatar sky <fakangwang@gmail.com> 2020-08-07 23:38:59 +0800
committerGravatar GitHub <noreply@github.com> 2020-08-07 17:38:59 +0200
commitcc8ba4b5a30784d8c1e365bbb358183ad973ec9a (patch)
tree4cccf8659a9b211450a6730fdd02644d4587087b /header_test.go
parent improve statusLine and StatusMessage by using slice instead of map (#855) (diff)
downloadfasthttp-cc8ba4b5a30784d8c1e365bbb358183ad973ec9a.tar.gz
fasthttp-cc8ba4b5a30784d8c1e365bbb358183ad973ec9a.tar.bz2
fasthttp-cc8ba4b5a30784d8c1e365bbb358183ad973ec9a.zip
Add a api `DisableNoDefaultContentType` to disable add default content type. (#859)
* Add api DisableNoDefaultContentType to disable add default contentype if no Content-Type header. * Update test case. * Update api name. * Update header.go Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com> Co-authored-by: Erik Dubbelboer <erik@dubbelboer.com>
Diffstat (limited to 'header_test.go')
-rw-r--r--header_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/header_test.go b/header_test.go
index 2ef2750..0fcca30 100644
--- a/header_test.go
+++ b/header_test.go
@@ -1240,7 +1240,7 @@ func TestResponseContentTypeNoDefaultNotEmpty(t *testing.T) {
var h ResponseHeader
- h.noDefaultContentType = true
+ h.SetNoDefaultContentType(true)
h.SetContentLength(5)
headers := h.String()
@@ -2193,10 +2193,10 @@ func TestResponseHeaderReadSuccess(t *testing.T) {
400, 123, string(defaultContentType), "foiaaa")
// no content-type and no default
- h.noDefaultContentType = true
+ h.SetNoDefaultContentType(true)
testResponseHeaderReadSuccess(t, h, "HTTP/1.1 400 OK\r\nContent-Length: 123\r\n\r\nfoiaaa",
400, 123, "", "foiaaa")
- h.noDefaultContentType = false
+ h.SetNoDefaultContentType(false)
// no headers
testResponseHeaderReadSuccess(t, h, "HTTP/1.1 200 OK\r\n\r\naaaabbb",