Commit 924212b4 by Agnès Toulet Committed by GitHub

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

parent 7f0802a9
......@@ -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}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment