On the typescript documentation page, it seems that the before*
hooks take in Options
as the first input.
But I'm pretty sure that's not the correct typing, because 1. the dnsCache
is always either missing, or is instantiated (whether you passed {dnsCache: true}
or {dnsCache: new CacheableLookup(...)}
during initialization), and 2. the url
is always an instance of the URL (you can see the code doing new URL(...)
before passing it as the options.url
.
I would expect there to be a separate "hook options" type, where the dnsCache
is undefined | CacheableLookup
and url
to be URL
N/A
N/A
url
always getting instantiated:
dnsCache
always getting instantiated:
Line 664 in b1d61c1
And I have extensive testing over at got-ssrf, where I would've seen tests fail if options.url
wasn't a URL
for either of the before*
hooks.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too