aboutsummaryrefslogtreecommitdiff
path: root/header.go
diff options
context:
space:
mode:
authorGravatar MoreFreeze <morefreeze@users.noreply.github.com> 2021-05-17 15:20:18 +0800
committerGravatar GitHub <noreply@github.com> 2021-05-17 09:20:18 +0200
commitffa0cabed8199819e372ebd2c739998914150ff2 (patch)
tree287ed33be99cee824e6c2eaebf3dfa7ab5e93c4f /header.go
parentfeature: add ConvertRequest func (#1024) (diff)
downloadfasthttp-ffa0cabed8199819e372ebd2c739998914150ff2.tar.gz
fasthttp-ffa0cabed8199819e372ebd2c739998914150ff2.tar.bz2
fasthttp-ffa0cabed8199819e372ebd2c739998914150ff2.zip
Use proper content-type when it is not present (#1023)
Co-authored-by: liuchenxing <liuchenxing@bytedance.com>
Diffstat (limited to 'header.go')
-rw-r--r--header.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/header.go b/header.go
index 3a552d9..7c9cc32 100644
--- a/header.go
+++ b/header.go
@@ -32,10 +32,10 @@ type ResponseHeader struct {
noDefaultContentType bool
noDefaultDate bool
- statusCode int
- contentLength int
- contentLengthBytes []byte
- secureErrorLogMessage bool
+ statusCode int
+ contentLength int
+ contentLengthBytes []byte
+ secureErrorLogMessage bool
contentType []byte
server []byte
@@ -64,9 +64,9 @@ type RequestHeader struct {
// for reducing RequestHeader object size.
cookiesCollected bool
- contentLength int
- contentLengthBytes []byte
- secureErrorLogMessage bool
+ contentLength int
+ contentLengthBytes []byte
+ secureErrorLogMessage bool
method []byte
requestURI []byte
@@ -1649,7 +1649,7 @@ func (h *RequestHeader) AppendBytes(dst []byte) []byte {
contentType := h.ContentType()
if len(contentType) == 0 && !h.ignoreBody() {
- contentType = strPostArgsContentType
+ contentType = strDefaultContentType
}
if len(contentType) > 0 {
dst = appendHeaderLine(dst, strContentType, contentType)