Skip to content

Commit

Permalink
move wayward comment
Browse files Browse the repository at this point in the history
  • Loading branch information
cblgh committed Mar 16, 2021
1 parent 5b5a86b commit 733c633
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/handlers/admin/notices.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func (h noticeHandler) addTranslation(rw http.ResponseWriter, req *http.Request)
return
}

// reply with 405 error: Method not allowed
if req.Method != "POST" {
err := weberrors.ErrBadRequest{Where: "http method type", Details: fmt.Errorf("add translation only accepts POST requests, sorry!")}
h.r.Error(rw, req, http.StatusMethodNotAllowed, err)
Expand All @@ -53,7 +54,6 @@ func (h noticeHandler) addTranslation(rw http.ResponseWriter, req *http.Request)
pinnedName := roomdb.PinnedNoticeName(req.FormValue("name"))
if !pinnedName.Valid() {
err := weberrors.ErrBadRequest{Where: "name", Details: fmt.Errorf("invalid pinned notice name")}
// reply with 405 error: Method not allowed
h.r.Error(rw, req, http.StatusInternalServerError, err)
return
}
Expand Down

0 comments on commit 733c633

Please sign in to comment.