diff --git a/context/context.go b/context/context.go index b281690f..46ba63c5 100644 --- a/context/context.go +++ b/context/context.go @@ -3201,12 +3201,14 @@ func (ctx *context) Problem(v interface{}, opts ...JSON) (int, error) { options.Indent = " " } - ctx.contentTypeOnce(ContentJSONProblemHeaderValue, "") - if p, ok := v.(Problem); ok { p.updateTypeToAbsolute(ctx) + code, _ := p.getStatus() + ctx.StatusCode(code) } + ctx.contentTypeOnce(ContentJSONProblemHeaderValue, "") + return ctx.JSON(v, options) }