Skip to content

Commit c4410fe

Browse files
pham vinh dataldas
pham vinh dat
authored andcommittedNov 22, 2024
fix(bind body): content-length can be -1
1 parent 5d98929 commit c4410fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

Diff for: ‎bind.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func (b *DefaultBinder) BindQueryParams(c Context, i interface{}) error {
6767
// See MIMEMultipartForm: https://golang.org/pkg/net/http/#Request.ParseMultipartForm
6868
func (b *DefaultBinder) BindBody(c Context, i interface{}) (err error) {
6969
req := c.Request()
70-
if req.ContentLength == 0 {
70+
if req.ContentLength <= 0 {
7171
return
7272
}
7373

0 commit comments

Comments
 (0)