From 6afde87385a37bf1addde9eb77b9fa69172a5a6d Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Wed, 15 Mar 2023 16:34:19 +0100 Subject: [PATCH] Return 400 Bad Request on Invalid CIDs --- http-gateways/PATH_GATEWAY.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/http-gateways/PATH_GATEWAY.md b/http-gateways/PATH_GATEWAY.md index beca39e53..a6b16977c 100644 --- a/http-gateways/PATH_GATEWAY.md +++ b/http-gateways/PATH_GATEWAY.md @@ -679,8 +679,9 @@ Gateway MUST respond with HTTP error when it is not possible to traverse the req - [`404 Not Found`](#404-not-found) should be returned when the root CID is valid and traversable, but the DAG it represents does not include content path remainder. - Error response body should indicate which part of immutable content path (`/ipfs/{cid}/path/to/file`) is missing +- [`400 Bad Request`](#400-bad-request) should be returned when the root CID under the `ipfs` namespace is invalid. - [`500 Internal Server Error`](#500-internal-server-error) can be used for remaining traversal errors, -such as invalid CIDs, domains that cannot be resolved, or IPNS keys that cannot be resolved. +such as domains that cannot be resolved, or IPNS keys that cannot be resolved. ## Best practices for HTTP caching