From adcce1ba8db01f543da21730f89c2672b2d42f51 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Tue, 4 Mar 2025 01:17:48 +0100 Subject: [PATCH] gateway: clarify 3XX on trustless gw 3XX create unnecessary overhead and it is desirable for spec to nudge implementers towards best practices that remove redirect overhead from server and client and shift solution to updating entry in routing system --- src/http-gateways/path-gateway.md | 7 +++++-- src/http-gateways/trustless-gateway.md | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/http-gateways/path-gateway.md b/src/http-gateways/path-gateway.md index 9d0e087a..bbd18019 100644 --- a/src/http-gateways/path-gateway.md +++ b/src/http-gateways/path-gateway.md @@ -314,8 +314,11 @@ A generic client error returned when it is not possible to return a better one ### `404` Not Found -Error to indicate that request was formally correct, but traversal of the -requested content path was not possible due to a invalid or missing DAG node. +Error indicating that the request was syntactically valid, but traversal +of the requested content path failed due to an invalid or missing DAG node. + +This error SHOULD occur when either the root CID is not provided by the gateway +or a specified sub-path does not exist within the DAG referenced by the root CID. ### `410` Gone diff --git a/src/http-gateways/trustless-gateway.md b/src/http-gateways/trustless-gateway.md index 1cf4c844..5a951ad1 100644 --- a/src/http-gateways/trustless-gateway.md +++ b/src/http-gateways/trustless-gateway.md @@ -235,6 +235,25 @@ In case both are present in the request, the value from the [`Accept`](#accept-r Below MUST be implemented **in addition** to "HTTP Response" of :cite[path-gateway]. +## Response Status Codes + +### `200` OK + +The request succeeded. + +If the HTTP method was `GET`, then data is transmitted in the message body. + +### `404` Not Found + +Error to indicate that requested resource is not provided by the gateway. + +### `3XX` Redirects + +Non-recursive trustless gateway SHOULD NOT return HTTP redirects. +Change of URL should occur by announcing it to the routing system. + +Clients SHOULD ignore redirects and interpret them the same way as `404`. + ## Response Headers ### `Content-Type` (response header)