Skip to content

Commit

Permalink
Merge pull request #3 from datacite/change_error_codes
Browse files Browse the repository at this point in the history
Change http status error codes
  • Loading branch information
richardhallett authored Oct 17, 2023
2 parents d71037c + 2a90990 commit 448dd29
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/app/net/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (s *Http) createMetric(w http.ResponseWriter, r *http.Request) {

// Return a bad request if useragent is a bot
if isBot(r.UserAgent()) {
http.Error(w, "Event request denied due to known bot", http.StatusBadRequest)
http.Error(w, "Event request denied due to known bot", http.StatusForbidden)
return
}

Expand All @@ -207,7 +207,7 @@ func (s *Http) createMetric(w http.ResponseWriter, r *http.Request) {
// Format error message
errorMessage := fmt.Sprintf("%s - %s, Usage stats cannot be processed", eventRequest.Pid, err.Error())

http.Error(w, errorMessage, http.StatusBadRequest)
http.Error(w, errorMessage, http.StatusUnprocessableEntity)

return
}
Expand Down

0 comments on commit 448dd29

Please sign in to comment.