From 65d35747fc7f6601267bc19361db49bc1611e0fd Mon Sep 17 00:00:00 2001 From: Midou36O Date: Sun, 18 Sep 2022 17:18:14 +0100 Subject: [PATCH] Fix Some more stuff, disabling form actually works now. --- api/announcements.go | 4 ++-- api/form.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/announcements.go b/api/announcements.go index 5cffff6..a9814d2 100644 --- a/api/announcements.go +++ b/api/announcements.go @@ -25,10 +25,10 @@ func CheckAnn() { } else { log.Println("Announcements disabled") http.HandleFunc("/announcements", func(w http.ResponseWriter, r *http.Request) { - http.Error(w, "Announcements are disabled.", http.StatusNotFound) + http.Error(w, "Announcements are disabled.", http.StatusServiceUnavailable) }) http.HandleFunc("/api/announcements", func(w http.ResponseWriter, r *http.Request) { - http.Error(w, "{\"enabled\": \"false\"}", http.StatusNotFound) + http.Error(w, "{\"enabled\": \"false\"}", http.StatusServiceUnavailable) }) } } diff --git a/api/form.go b/api/form.go index e1181cc..ee0f780 100644 --- a/api/form.go +++ b/api/form.go @@ -27,11 +27,11 @@ func FormCheck() { Form() } else { log.Println("Forms disabled") - http.HandleFunc("/api/form", func(w http.ResponseWriter, r *http.Request) { - io.WriteString(w, "Disabled") - }) http.HandleFunc("/form", func(w http.ResponseWriter, r *http.Request) { - io.WriteString(w, "Disabled") + http.Error(w, "Form is disabled.", http.StatusServiceUnavailable) + }) + http.HandleFunc("/api/form", func(w http.ResponseWriter, r *http.Request) { + http.Error(w, "{\"enabled\": \"false\"}", http.StatusServiceUnavailable) }) } }