Fix Some more stuff, disabling form actually works now.
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Midou36O 2022-09-18 17:18:14 +01:00
parent af39a52971
commit 65d35747fc
Signed by: midou
GPG Key ID: 08063D5407090BC2
2 changed files with 6 additions and 6 deletions

View File

@ -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)
})
}
}

View File

@ -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)
})
}
}