Skip to content

Commit

Permalink
httptransport: remove redundant method check
Browse files Browse the repository at this point in the history
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
  • Loading branch information
hdonnay committed Oct 1, 2020
1 parent 015d862 commit 2c9762b
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions httptransport/indexhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@ const (
// Index of a manifest.
func IndexHandler(serv indexer.StateIndexer) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodPost {
resp := &je.Response{
Code: "method-not-allowed",
Message: "endpoint only allows POST",
}
je.Error(w, resp, http.StatusMethodNotAllowed)
return
}

ctx := r.Context()
w.Header().Set("content-type", "application/json")
if r.Method != http.MethodPost {
Expand Down

0 comments on commit 2c9762b

Please sign in to comment.