From 088325073247e2f7bc85fd3baafdad1ea6a635a5 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 22 Mar 2025 11:53:04 +0800 Subject: Add HTTP 451 --- http_error_page.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'http_error_page.go') 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) +} -- cgit v1.2.3