From 999bb7d65ecf61f59f8d54a60362307537e49030 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Tue, 25 Mar 2025 12:49:28 +0800 Subject: Add 403 and 501 pages --- http_error_page.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'http_error_page.go') diff --git a/http_error_page.go b/http_error_page.go index 0ddf055..355b504 100644 --- a/http_error_page.go +++ b/http_error_page.go @@ -18,6 +18,12 @@ func errorPage400(w http.ResponseWriter, params map[string]any, msg string) { _ = templates.ExecuteTemplate(w, "400", params) } +func errorPage403(w http.ResponseWriter, params map[string]any, msg string) { + w.WriteHeader(http.StatusForbidden) + params["complete_error_msg"] = msg + _ = templates.ExecuteTemplate(w, "403", params) +} + func errorPage451(w http.ResponseWriter, params map[string]any, msg string) { w.WriteHeader(http.StatusUnavailableForLegalReasons) params["complete_error_msg"] = msg @@ -29,3 +35,8 @@ func errorPage500(w http.ResponseWriter, params map[string]any, msg string) { params["complete_error_msg"] = msg _ = templates.ExecuteTemplate(w, "500", params) } + +func errorPage501(w http.ResponseWriter, params map[string]any) { + w.WriteHeader(http.StatusNotImplemented) + _ = templates.ExecuteTemplate(w, "501", params) +} -- cgit v1.2.3