Skip to content

Commit

Permalink
forgotten set status on Problem type
Browse files Browse the repository at this point in the history
as remindered at kataras#1335 (comment)


Former-commit-id: 7fc7742c5c3374718fbf39530c45fa068b5d433a
  • Loading branch information
kataras committed Aug 14, 2019
1 parent b98bb5a commit 43754b9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 43754b9

Please sign in to comment.