Skip to content

Commit e372bc6

Browse files
committed
refactor(gateway): match 410 before 404s
just a precaution to ensure 410 takes precedence, until we address ipfs#591
1 parent 28f4bc8 commit e372bc6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gateway/errors.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,10 @@ func webError(w http.ResponseWriter, r *http.Request, c *Config, err error, defa
186186
switch {
187187
case errors.Is(err, &cid.ErrInvalidCid{}):
188188
code = http.StatusBadRequest
189-
case isErrNotFound(err):
190-
code = http.StatusNotFound
191189
case isErrContentBlocked(err):
192190
code = http.StatusGone
191+
case isErrNotFound(err):
192+
code = http.StatusNotFound
193193
case errors.Is(err, context.DeadlineExceeded):
194194
code = http.StatusGatewayTimeout
195195
}

0 commit comments

Comments
 (0)