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

timeout option has no effect if set on Request #84

Open
stefan-guggisberg opened this issue Feb 3, 2020 · 0 comments
Open

timeout option has no effect if set on Request #84

stefan-guggisberg opened this issue Feb 3, 2020 · 0 comments

Comments

@stefan-guggisberg
Copy link
Contributor

I assume the following 2 fetch invocations should behave identically, i.e. both should throw a TimeoutError:

A: Passing url and options directly to fetch():

  const resp = await fetch('https://httpbin.org/delay/5', { timeout: 1000 });

B: Passing url and options via Request instance to fetch():

  const req = new Request('https://httpbin.org/delay/5', { timeout: 1000 });
  const resp = await fetch(req);

A throws a TimeoutError as expected. B OTOH ignores the timeout option and succeeds.

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

No branches or pull requests

1 participant