diff options
author | MoreFreeze <morefreeze@users.noreply.github.com> | 2021-05-17 15:20:18 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-17 09:20:18 +0200 |
commit | ffa0cabed8199819e372ebd2c739998914150ff2 (patch) | |
tree | 287ed33be99cee824e6c2eaebf3dfa7ab5e93c4f /header.go | |
parent | feature: add ConvertRequest func (#1024) (diff) | |
download | fasthttp-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.go | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -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) |