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

prefixUrl is ignored causing URL building to fail #369

Open
Mnkras opened this issue Aug 1, 2023 · 1 comment
Open

prefixUrl is ignored causing URL building to fail #369

Mnkras opened this issue Aug 1, 2023 · 1 comment

Comments

@Mnkras
Copy link

Mnkras commented Aug 1, 2023

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: sindresorhus/got#1188
Since it is now resolved, do we still need this code?

Can we remove this extra parsing?

@alexghr
Copy link
Owner

alexghr commented Aug 2, 2023

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.

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

2 participants