diff options
Diffstat (limited to 'dashboard/app/handler.go')
| -rw-r--r-- | dashboard/app/handler.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/dashboard/app/handler.go b/dashboard/app/handler.go index 6a115d0b2..6b72da0bb 100644 --- a/dashboard/app/handler.go +++ b/dashboard/app/handler.go @@ -50,7 +50,8 @@ func handleContext(fn contextHandler) http.Handler { http.Error(w, "403 Forbidden", http.StatusForbidden) return } - if redir, ok := err.(ErrRedirect); ok { + var redir *ErrRedirect + if errors.As(err, &redir) { http.Redirect(w, r, redir.Error(), http.StatusFound) return } @@ -201,7 +202,7 @@ func commonHeader(c context.Context, r *http.Request, w http.ResponseWriter, ns ns = adminPage } if ns != adminPage || !isAdminPage { - return nil, ErrRedirect{fmt.Errorf("/%v", ns)} + return nil, &ErrRedirect{fmt.Errorf("/%v", ns)} } } if ns != adminPage { |
