From 26a2bab79715763b4fb1b989936c5816c2115dd8 Mon Sep 17 00:00:00 2001 From: Eric Tune Date: Thu, 16 Oct 2014 09:25:54 -0700 Subject: [PATCH] Add forbidden error. Will be used in subsequent PRs that add authorization. --- pkg/apiserver/errors.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/apiserver/errors.go b/pkg/apiserver/errors.go index 460d57540e1..bb859409523 100644 --- a/pkg/apiserver/errors.go +++ b/pkg/apiserver/errors.go @@ -70,3 +70,9 @@ func badGatewayError(w http.ResponseWriter, req *http.Request) { w.WriteHeader(http.StatusBadGateway) fmt.Fprintf(w, "Bad Gateway: %#v", req.RequestURI) } + +// forbidden renders a simple forbidden error +func forbidden(w http.ResponseWriter, req *http.Request) { + w.WriteHeader(http.StatusForbidden) + fmt.Fprintf(w, "Forbidden: %#v", req.RequestURI) +}