mirror of
https://github.com/kataras/iris.git
synced 2025-03-13 21:36:28 +01:00
forgotten set status on Problem type
as remindered at https://github.com/kataras/iris/issues/1335#issuecomment-521319721 Former-commit-id: 7fc7742c5c3374718fbf39530c45fa068b5d433a
This commit is contained in:
parent
b98bb5a870
commit
43754b9c94
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user