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

fix memory leaks #356

This commit is contained in:
Oleg Lobanov 2016-02-05 15:40:39 +04:00
parent 68c86e3f90
commit 1c6658e48a

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, "Requesr body can't be nil")
return
}
defer r.Body.Close()
ct := r.Header.Get(ContentType)
err = ErrUnsupportedMediaType
switch {