aboutsummaryrefslogtreecommitdiff
path: root/http_error_page.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-25 12:49:28 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-25 12:49:28 +0800
commit999bb7d65ecf61f59f8d54a60362307537e49030 (patch)
tree2f5d76e82d3b178b5dcb08182c8690534e446407 /http_error_page.go
parentRemove unnecessary whitespace in branches template (diff)
downloadforge-999bb7d65ecf61f59f8d54a60362307537e49030.tar.gz
forge-999bb7d65ecf61f59f8d54a60362307537e49030.tar.zst
forge-999bb7d65ecf61f59f8d54a60362307537e49030.zip
Add 403 and 501 pages
Diffstat (limited to 'http_error_page.go')
-rw-r--r--http_error_page.go11
1 files changed, 11 insertions, 0 deletions
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)
+}