Skip to content

Commit 19f5042

Browse files
authored
gateway: clarify entiry-bytes out of range
Cosmetic clarification based on discussion that happened in ipfs/boxo#523
1 parent 956afd1 commit 19f5042

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/http-gateways/trustless-gateway.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,16 +155,16 @@ The following additional values are supported:
155155
A Gateway MUST augment the returned `Etag` based on the passed `entity-bytes`.
156156

157157
A Gateway SHOULD return an HTTP 400 Bad Request error when the requested range
158-
cannot be parsed as valid offset positions.
158+
is outside of valid offset positions in full, and the gateway knows that upfront.
159159

160160
In more nuanced error scenarios, a Gateway MUST return a valid CAR response
161161
that includes enough blocks for the client to understand why the requested
162162
`entity-bytes` was incorrect or why only a part of the requested byte range was
163163
returned:
164164

165165
- If the requested `entity-bytes` resolves to a range that partially falls
166-
outside the entity's byte range, the response MUST include the subset of
167-
blocks within the entity's bytes.
166+
outside the entity's byte range (before or after),
167+
the response MUST include the subset of blocks within the entity's bytes.
168168
- This allows clients to request valid ranges of the entity without needing
169169
to know its total size beforehand, and it does not require the Gateway to
170170
buffer the entire entity before returning the response.

0 commit comments

Comments
 (0)