use http consts for request methods

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2022-11-02 23:31:23 +01:00
parent 7f9f86c411
commit f9ccd2c6ea
33 changed files with 211 additions and 211 deletions

View File

@@ -13,7 +13,7 @@ var (
// DownHandler registers a manual_http_status that always returns an Error
func DownHandler(w http.ResponseWriter, r *http.Request) {
if r.Method == "POST" {
if r.Method == http.MethodPost {
updater.Update(errors.New("manual Check"))
} else {
w.WriteHeader(http.StatusNotFound)
@@ -22,7 +22,7 @@ func DownHandler(w http.ResponseWriter, r *http.Request) {
// UpHandler registers a manual_http_status that always returns nil
func UpHandler(w http.ResponseWriter, r *http.Request) {
if r.Method == "POST" {
if r.Method == http.MethodPost {
updater.Update(nil)
} else {
w.WriteHeader(http.StatusNotFound)