Skip to content

Support timeout on fetch requests #1

Closed
@ramboz

Description

@ramboz

Is your feature request related to a problem? Please describe.
Running multiple fetch requests in parallel may end up causing denial-of-service attacks if they are long-lived.

Describe the solution you'd like
Regular XHR requests support a timeout that will fail the request after a specific amount of time.
There is currently no clear spec for it in the fetch API, but some discussion around it exist (see links below)

Would be great to have a first draft implementation in the library to offer a decent enough implementation until the spec is finalized.

Describe alternatives you've considered
This can alternatively be implemented consumer-side by using timeouts and promises, and rejecting the promise before the request ends, but the socket is still left open until the fetch actually finishes so it doesn't fully removes the issue

Additional context
See:

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions