From 924212b42bf7d190764d12ac8003fcedb939a0f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agn=C3=A8s=20Toulet?= <35176601+AgnesToulet@users.noreply.github.com> Date: Wed, 9 Dec 2020 15:08:53 +0100 Subject: [PATCH] API: add Status() to RedirectResponse (#29722) --- pkg/api/common.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/api/common.go b/pkg/api/common.go index 7c88bfd45f8..72ae41e5643 100644 --- a/pkg/api/common.go +++ b/pkg/api/common.go @@ -145,6 +145,11 @@ func (r *RedirectResponse) WriteTo(ctx *models.ReqContext) { ctx.Redirect(r.location) } +// Status gets the response's status. +func (*RedirectResponse) Status() int { + return http.StatusFound +} + func Redirect(location string) *RedirectResponse { return &RedirectResponse{location: location} }