API: add Status() to RedirectResponse (#29722)

This commit is contained in:
Agnès Toulet 2020-12-09 15:08:53 +01:00 committed by GitHub
parent 7f0802a9c9
commit 924212b42b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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}
}