got-fetch
got-fetch copied to clipboard
prefixUrl is ignored causing URL building to fail
In fetch.ts there is this code:
const url = new URL(typeof input === 'string' ? input : input.url);
that assumes that the input will always be a full URL or object with a full URL.
That is an incorrect assumption and breaks got clients using prefixUrl since input
is just a path (/something
)
It seems all this logic is to merge query params which references this got bug: https://github.com/sindresorhus/got/issues/1188 Since it is now resolved, do we still need this code?
Can we remove this extra parsing?
Based on #370, restoring the deleted test and running it against the new code (that doesn't separate search params) still fails so I think we still need the code. I have made suggestion to make both prefixUrl
and searchParams
merging work together.