Closed bwestergard closed 1 year ago
There already is a timeout logic, but just until it receives the header:
https://github.com/derhuerst/gemini/blob/f1f6673e6bf6a5443ead336575ddfb989971ea87/client.js#L49-L52
We could
opt.headersTimeout
& opt.bodyTimeout
/opt.timeout
Node.js seems to emit this error if the underlying socket of an HTTP request times out:
I have added opt.headersTimeout
& opt.timeout
(for the first byte of the body).
A maximum time of the whole request (including the download of the response) seems out of scope of this library because it makes assumptions about the body size and/or connection speed; I think it would fit nicely into gemini-fetch
's scope. @RangerMauve what do you think?
In addition to the current connection timeout option, it would be quite handy to have a global timeout for requests, akin to gemget's
--max-time
option.