Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support timeout on fetch requests #1

Closed
ramboz opened this issue Jan 31, 2020 · 1 comment
Closed

Support timeout on fetch requests #1

ramboz opened this issue Jan 31, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@ramboz
Copy link

ramboz commented Jan 31, 2020

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:

@ramboz ramboz added the enhancement New feature or request label Jan 31, 2020
@ramboz ramboz changed the title Implement timeout support Support timeout on fetch requests Jan 31, 2020
@stefan-guggisberg stefan-guggisberg self-assigned this Feb 1, 2020
trieloff pushed a commit that referenced this issue Feb 3, 2020
# [1.1.0](v1.0.0...v1.1.0) (2020-02-03)

### Features

* support timeout on fetch requests; doc and test ([ce6c1ce](ce6c1ce)), closes [#1](#1)
@stefan-guggisberg
Copy link
Contributor

supported in v1.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants