1
0
mirror of https://github.com/labstack/echo.git synced 2024-11-24 08:22:21 +02:00

fix(bind body): content-length can be -1

This commit is contained in:
pham vinh dat 2024-11-22 14:44:19 +07:00 committed by Martti T.
parent 5d98929328
commit c4410fe0b8

View File

@ -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
}