aboutsummaryrefslogtreecommitdiff
path: root/http_error_page.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-22 11:44:59 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-22 11:44:59 +0800
commitc7440c2c3366e516ef9b0f4c34093e0c7f5c23d4 (patch)
tree4695fba3ffb65a2abbadda90bac2c7511ffcaaf7 /http_error_page.go
parentFix HTTPS cloning (diff)
downloadforge-c7440c2c3366e516ef9b0f4c34093e0c7f5c23d4.tar.gz
forge-c7440c2c3366e516ef9b0f4c34093e0c7f5c23d4.tar.zst
forge-c7440c2c3366e516ef9b0f4c34093e0c7f5c23d4.zip
Fix tree/raw redirection and disallow slashes in their path segments
Diffstat (limited to 'http_error_page.go')
-rw-r--r--http_error_page.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/http_error_page.go b/http_error_page.go
index aabc9bd..3980797 100644
--- a/http_error_page.go
+++ b/http_error_page.go
@@ -11,3 +11,9 @@ func errorPage404(w http.ResponseWriter, params map[string]any) {
w.WriteHeader(404)
_ = templates.ExecuteTemplate(w, "404", params)
}
+
+func errorPage400(w http.ResponseWriter, params map[string]any, msg string) {
+ w.WriteHeader(400)
+ params["bad_request_msg"] = msg
+ _ = templates.ExecuteTemplate(w, "400", params)
+}