From c4410fe0b88ee0d395e23ba8b0fdfcfbce18a7ca Mon Sep 17 00:00:00 2001 From: pham vinh dat Date: Fri, 22 Nov 2024 14:44:19 +0700 Subject: [PATCH] fix(bind body): content-length can be -1 --- bind.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bind.go b/bind.go index ed7ca324..acc34650 100644 --- a/bind.go +++ b/bind.go @@ -67,7 +67,7 @@ func (b *DefaultBinder) BindQueryParams(c Context, i interface{}) error { // See MIMEMultipartForm: https://golang.org/pkg/net/http/#Request.ParseMultipartForm func (b *DefaultBinder) BindBody(c Context, i interface{}) (err error) { req := c.Request() - if req.ContentLength == 0 { + if req.ContentLength <= 0 { return }