From 2c0347566f99afec2e3963d74f4fc970e6187217 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Sun, 30 Mar 2025 17:34:11 +0200 Subject: feat: Add initial support for http git clone --- pkg/ext/router.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'pkg/ext') 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) -- cgit v1.2.3