Fix Some more stuff, disabling form actually works now.
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
af39a52971
commit
65d35747fc
@ -25,10 +25,10 @@ func CheckAnn() {
|
|||||||
} else {
|
} else {
|
||||||
log.Println("Announcements disabled")
|
log.Println("Announcements disabled")
|
||||||
http.HandleFunc("/announcements", func(w http.ResponseWriter, r *http.Request) {
|
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.HandleFunc("/api/announcements", func(w http.ResponseWriter, r *http.Request) {
|
||||||
http.Error(w, "{\"enabled\": \"false\"}", http.StatusNotFound)
|
http.Error(w, "{\"enabled\": \"false\"}", http.StatusServiceUnavailable)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,11 +27,11 @@ func FormCheck() {
|
|||||||
Form()
|
Form()
|
||||||
} else {
|
} else {
|
||||||
log.Println("Forms disabled")
|
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) {
|
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)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user