1
0
mirror of https://github.com/labstack/echo.git synced 2025-02-03 13:11:39 +02:00

Merge pull request #358 from o1egl/bind_form

fix memory leaks #356
This commit is contained in:
Vishal Rana 2016-02-06 07:25:25 -08:00
commit bb0735bbc5

View File

@ -36,6 +36,11 @@ func (b *binder) MaxMemory() int64 {
}
func (b *binder) Bind(r *http.Request, i interface{}) (err error) {
if r.Body == nil {
err = NewHTTPError(http.StatusBadRequest, "Request body can't be nil")
return
}
defer r.Body.Close()
ct := r.Header.Get(ContentType)
err = ErrUnsupportedMediaType
switch {