Skip to content

Commit

Permalink
fix tests 2
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-goodisman committed Apr 4, 2024
1 parent 03b44b9 commit e64c267
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/denylist/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ func listDenylistKeys(response http.ResponseWriter, denylist *Denylist) {
keys := denylist.GetKeys()

response.Header().Set("Content-Type", "application/json")
response.WriteHeader(http.StatusOK)
err := json.NewEncoder(response).Encode(keys)
if err != nil {
http.Error(response, "couldn't encode result", http.StatusInternalServerError)
return
}
response.WriteHeader(http.StatusOK)
}

// PUT /denylist
Expand Down Expand Up @@ -75,12 +75,12 @@ func createDenylistEntry(response http.ResponseWriter, request *http.Request, de
}

response.Header().Set("Content-Type", "application/json")
response.WriteHeader(http.StatusCreated)
err = json.NewEncoder(response).Encode(id)
if err != nil {
http.Error(response, "couldn't encode result", http.StatusInternalServerError)
return
}
response.WriteHeader(http.StatusCreated)
}

// GET /denylist/...
Expand All @@ -98,12 +98,12 @@ func getDenylistEntry(response http.ResponseWriter, request *http.Request, denyl
}

response.Header().Set("Content-Type", "application/json")
response.WriteHeader(http.StatusOK)
err := json.NewEncoder(response).Encode(payload)
if err != nil {
http.Error(response, "couldn't encode result", http.StatusInternalServerError)
return
}
response.WriteHeader(http.StatusOK)
}

// DELETE /denylist/...
Expand Down

0 comments on commit e64c267

Please sign in to comment.