1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-15 01:34:53 +02:00

Add Conditions to Ensure Bind Succeeds with Transfer-Encoding: chunked (#2717)

* Add conditions to ensure Bind succeeds with `Transfer-Encoding: chunked`.

* Revert the ContentLength conditions for BindBody
This commit is contained in:
Masahiro Furudate
2024-12-11 19:04:21 +09:00
committed by GitHub
parent 3b017855b4
commit 0368ed87f2
2 changed files with 26 additions and 2 deletions

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
}