Skip to content

Commit b3863a6

Browse files
authored
Merge pull request #435 from ipfs/feat/document-retry-after
2 parents c3be8c1 + b4631ba commit b3863a6

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

src/http-gateways/path-gateway.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,9 @@ sent by the client.
291291

292292
### `429` Too Many Requests
293293

294-
A
295-
[`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After)
296-
header might be included to this response, indicating how long to wait before
297-
making a new request.
294+
Error to indicate the client has sent too many requests in a given amount of time.
295+
296+
This error response SHOULD include [`Retry-After`](#retry-after-response-header) HTTP header to indicate how long the client should wait before making a follow-up request.
298297

299298
### `451` Unavailable For Legal Reasons
300299

@@ -308,9 +307,21 @@ See: [Denylists](#denylists)
308307

309308
A generic server error returned when it is not possible to return a better one.
310309

310+
### `502` Bad Gateway
311+
312+
Returned immediately when Gateway was not able to produce response for a known reason.
313+
For example, when gateway failed to find any providers for requested data.
314+
315+
This error response SHOULD include [`Retry-After`](#retry-after-response-header) HTTP header to indicate how long the client should wait before retrying.
316+
311317
### `504` Gateway Timeout
312318

313-
Returned when Gateway was not able to produce response under set limits.
319+
Returned when Gateway was not able to produce response under set time limits.
320+
For example, when gateway failed to retrieve data from a remote provider.
321+
322+
There is no generic timeout, Gateway implementations SHOULD set timeouts based on specific use cases.
323+
324+
This error response SHOULD include [`Retry-After`](#retry-after-response-header) HTTP header to indicate how long the client should wait before retrying.
314325

315326
## Response Headers
316327

@@ -551,6 +562,14 @@ Optional, present in certain response types:
551562
non-executable binary response types are not used in `<script>` and `<style>`
552563
HTML tags.
553564

565+
### `Retry-After` (response header)
566+
567+
Gateway returns this header with error responses such as [`429 Too Many Requests`](#429-too-many-requests) or [`504 Gateway Timeout`](#504-gateway-timeout).
568+
569+
The "Retry-After" header indicates how long the user agent ought to wait before making a follow-up request.
570+
571+
See Section 10.2.3 of :cite[rfc9110].
572+
554573
### `Server-Timing` (response header)
555574

556575
Optional. Implementations MAY use this header to communicate one or more

0 commit comments

Comments
 (0)