From 7487f95687c9d4f0ba2476cf50b673282cf4c162 Mon Sep 17 00:00:00 2001 From: Dan Slimmon Date: Tue, 7 Jun 2016 18:44:43 +0000 Subject: [PATCH] Fixed Content-Type problem when `BindWith()` fails. Resolves #633. --- context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/context.go b/context.go index 5d3b6a4e..412e9bf8 100644 --- a/context.go +++ b/context.go @@ -297,7 +297,7 @@ func (c *Context) BindJSON(obj interface{}) error { // See the binding package. func (c *Context) BindWith(obj interface{}, b binding.Binding) error { if err := b.Bind(c.Request, obj); err != nil { - c.AbortWithError(400, err).SetType(ErrorTypeBind) + c.Error(err).SetType(ErrorTypeBind) return err } return nil