aboutsummaryrefslogtreecommitdiff
path: root/pkg/ext/router.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/ext/router.go')
-rw-r--r--pkg/ext/router.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/ext/router.go b/pkg/ext/router.go
index ce4c126..434972b 100644
--- a/pkg/ext/router.go
+++ b/pkg/ext/router.go
@@ -69,6 +69,13 @@ func NotFound(w http.ResponseWriter, r *http.Request) {
}, r.Context())
}
+func BadRequest(w http.ResponseWriter, r *http.Request, msg string) {
+ w.WriteHeader(http.StatusBadRequest)
+ templates.WritePageTemplate(w, &templates.ErrorPage{
+ Message: msg,
+ }, r.Context())
+}
+
func Redirect(w http.ResponseWriter, location string) {
w.Header().Add("location", location)
w.WriteHeader(http.StatusTemporaryRedirect)