Fixed Content-Type problem when BindWith() fails. Resolves #633.

This commit is contained in:
Dan Slimmon 2016-06-07 18:44:43 +00:00
parent f931d1ea80
commit 7487f95687

View File

@ -297,7 +297,7 @@ func (c *Context) BindJSON(obj interface{}) error {
// See the binding package. // See the binding package.
func (c *Context) BindWith(obj interface{}, b binding.Binding) error { func (c *Context) BindWith(obj interface{}, b binding.Binding) error {
if err := b.Bind(c.Request, obj); err != nil { if err := b.Bind(c.Request, obj); err != nil {
c.AbortWithError(400, err).SetType(ErrorTypeBind) c.Error(err).SetType(ErrorTypeBind)
return err return err
} }
return nil return nil