Skip to content

Commit

Permalink
refactor(gateway): match 410 before 404s
Browse files Browse the repository at this point in the history
just a precaution to ensure 410 takes precedence, until we address
#591
  • Loading branch information
lidel committed Jul 30, 2024
1 parent 28f4bc8 commit e372bc6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gateway/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ func webError(w http.ResponseWriter, r *http.Request, c *Config, err error, defa
switch {
case errors.Is(err, &cid.ErrInvalidCid{}):
code = http.StatusBadRequest
case isErrNotFound(err):
code = http.StatusNotFound
case isErrContentBlocked(err):
code = http.StatusGone
case isErrNotFound(err):
code = http.StatusNotFound
case errors.Is(err, context.DeadlineExceeded):
code = http.StatusGatewayTimeout
}
Expand Down

0 comments on commit e372bc6

Please sign in to comment.