Skip to content

Commit

Permalink
use semantic http status constant
Browse files Browse the repository at this point in the history
Signed-off-by: Josh Gwosdz <jgwosdz@redhat.com>
  • Loading branch information
erdii committed Mar 2, 2021
1 parent 67bf464 commit ec3fd77
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/jiralert/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func pageTemplate(name string) *template.Template {
func HomeHandlerFunc() func(http.ResponseWriter, *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
if r.Method != "GET" {
w.WriteHeader(400)
w.WriteHeader(http.StatusBadRequest)
w.Write([]byte("only GET allowed"))
return
}
Expand All @@ -117,7 +117,7 @@ func HomeHandlerFunc() func(http.ResponseWriter, *http.Request) {
func ConfigHandlerFunc(config *config.Config) func(http.ResponseWriter, *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
if r.Method != "GET" {
w.WriteHeader(400)
w.WriteHeader(http.StatusBadRequest)
w.Write([]byte("only GET allowed"))
return
}
Expand Down

0 comments on commit ec3fd77

Please sign in to comment.