Point user to POST if they try to GET /-/reload (#2172)

This commit is contained in:
Brian Brazil 2016-11-07 15:14:22 +00:00 committed by GitHub
parent a94a8807f9
commit 79f8514c9c
1 changed files with 4 additions and 0 deletions

View File

@ -191,6 +191,10 @@ func New(o *Options) *Handler {
}
router.Post("/-/reload", h.reload)
router.Get("/-/reload", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusMethodNotAllowed)
fmt.Fprintf(w, "This endpoint requires a POST request.\n")
})
router.Get("/debug/*subpath", http.DefaultServeMux.ServeHTTP)
router.Post("/debug/*subpath", http.DefaultServeMux.ServeHTTP)