diff options
author | kinggo <lilong.21@bytedance.com> | 2022-12-25 16:38:13 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-25 09:38:13 +0100 |
commit | c637221c5f34859271e3af47da6ab9a910b29511 (patch) | |
tree | 92565d0cac6f43ce896ba8cc5a14c69ef63e7e6e /http.go | |
parent | feat: support custom formvalue function (#1453) (diff) | |
download | fasthttp-c637221c5f34859271e3af47da6ab9a910b29511.tar.gz fasthttp-c637221c5f34859271e3af47da6ab9a910b29511.tar.bz2 fasthttp-c637221c5f34859271e3af47da6ab9a910b29511.zip |
optimize: allow http head when use getonly (#1456)
Diffstat (limited to 'http.go')
-rw-r--r-- | http.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1129,7 +1129,7 @@ func (req *Request) readLimitBody(r *bufio.Reader, maxBodySize int, getOnly bool // Do not reset the request here - the caller must reset it before // calling this method. - if getOnly && !req.Header.IsGet() { + if getOnly && !req.Header.IsGet() && !req.Header.IsHead() { return ErrGetOnly } @@ -1147,7 +1147,7 @@ func (req *Request) readBodyStream(r *bufio.Reader, maxBodySize int, getOnly boo // Do not reset the request here - the caller must reset it before // calling this method. - if getOnly && !req.Header.IsGet() { + if getOnly && !req.Header.IsGet() && !req.Header.IsHead() { return ErrGetOnly } |