From e372bc62de4c804dea26e93360e061f507081c57 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Tue, 30 Jul 2024 15:37:01 +0200 Subject: [PATCH] refactor(gateway): match 410 before 404s just a precaution to ensure 410 takes precedence, until we address https://github.com/ipfs/boxo/issues/591 --- gateway/errors.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gateway/errors.go b/gateway/errors.go index 2bbde1750..5ea15ff18 100644 --- a/gateway/errors.go +++ b/gateway/errors.go @@ -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 }