aboutsummaryrefslogtreecommitdiff
path: root/http_error_page.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-22 11:53:04 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-22 11:53:04 +0800
commit088325073247e2f7bc85fd3baafdad1ea6a635a5 (patch)
tree57a8d5b42e9b6b55cc51146edc2848fb174ff440 /http_error_page.go
parentFix tree/raw redirection and disallow slashes in their path segments (diff)
downloadforge-088325073247e2f7bc85fd3baafdad1ea6a635a5.tar.gz
forge-088325073247e2f7bc85fd3baafdad1ea6a635a5.tar.zst
forge-088325073247e2f7bc85fd3baafdad1ea6a635a5.zip
Add HTTP 451
Diffstat (limited to 'http_error_page.go')
-rw-r--r--http_error_page.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/http_error_page.go b/http_error_page.go
index 3980797..cb9e6ed 100644
--- a/http_error_page.go
+++ b/http_error_page.go
@@ -14,6 +14,12 @@ func errorPage404(w http.ResponseWriter, params map[string]any) {
func errorPage400(w http.ResponseWriter, params map[string]any, msg string) {
w.WriteHeader(400)
- params["bad_request_msg"] = msg
+ params["complete_error_msg"] = msg
_ = templates.ExecuteTemplate(w, "400", params)
}
+
+func errorPage451(w http.ResponseWriter, params map[string]any, msg string) {
+ w.WriteHeader(451)
+ params["complete_error_msg"] = msg
+ _ = templates.ExecuteTemplate(w, "451", params)
+}