diff options
| author | Runxi Yu <me@runxiyu.org> | 2025-03-22 11:44:59 +0800 |
|---|---|---|
| committer | Runxi Yu <me@runxiyu.org> | 2025-03-22 11:44:59 +0800 |
| commit | c7440c2c3366e516ef9b0f4c34093e0c7f5c23d4 (patch) | |
| tree | 4695fba3ffb65a2abbadda90bac2c7511ffcaaf7 /http_error_page.go | |
| parent | Fix HTTPS cloning (diff) | |
| download | forge-c7440c2c3366e516ef9b0f4c34093e0c7f5c23d4.tar.gz forge-c7440c2c3366e516ef9b0f4c34093e0c7f5c23d4.tar.zst forge-c7440c2c3366e516ef9b0f4c34093e0c7f5c23d4.zip | |
Fix tree/raw redirection and disallow slashes in their path segments
Diffstat (limited to '')
| -rw-r--r-- | http_error_page.go | 6 |
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) +} |
