The above statement hangs forever (i.e. ~75s in my case on macos). Aborting the request using AbortController doesn't work either. The timeout option seems only to apply for already established connections.
SImilar problem exists with https:// where a timeout can be set in the context options, e.g.
new Context( { session: { timeout: 1000 } }), but the timeout event is not handled:
The
timeout
fetch option doesn't account for the time it takes to establish a connection.An example:
The above statement hangs forever (i.e. ~75s in my case on macos). Aborting the request using
AbortController
doesn't work either. Thetimeout
option seems only to apply for already established connections.The problem is here: https://github.com/grantila/fetch-h2/blob/master/lib/context-http1.ts#L375, where no timeout is set. Something like the following should work (sorry, not Typescript):
SImilar problem exists with
https://
where atimeout
can be set in the context options, e.g.new Context( { session: { timeout: 1000 } })
, but thetimeout
event is not handled:https://github.com/grantila/fetch-h2/blob/master/lib/context-https.ts#L53