From 43754b9c94fd8117277abfe84d5436ed5795dfe8 Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Wed, 14 Aug 2019 19:41:30 +0300 Subject: [PATCH] forgotten set status on Problem type as remindered at https://github.com/kataras/iris/issues/1335#issuecomment-521319721 Former-commit-id: 7fc7742c5c3374718fbf39530c45fa068b5d433a --- context/context.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/context/context.go b/context/context.go index b281690f7..46ba63c5c 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) }