aboutsummaryrefslogtreecommitdiff
path: root/http.go
diff options
context:
space:
mode:
authorGravatar kinggo <lilong.21@bytedance.com> 2022-12-25 16:38:13 +0800
committerGravatar GitHub <noreply@github.com> 2022-12-25 09:38:13 +0100
commitc637221c5f34859271e3af47da6ab9a910b29511 (patch)
tree92565d0cac6f43ce896ba8cc5a14c69ef63e7e6e /http.go
parentfeat: support custom formvalue function (#1453) (diff)
downloadfasthttp-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.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/http.go b/http.go
index 25defad..3d1429c 100644
--- a/http.go
+++ b/http.go
@@ -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
}