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

TypeError [ERR_INVALID_URL]: Invalid URL #3

Open
StarpTech opened this issue Apr 24, 2023 · 1 comment
Open

TypeError [ERR_INVALID_URL]: Invalid URL #3

StarpTech opened this issue Apr 24, 2023 · 1 comment

Comments

@StarpTech
Copy link

StarpTech commented Apr 24, 2023

Hi, I started the server and tried to make a simple GET call through the browser. It errors with:

 straightforward onUncaughtException:   TypeError [ERR_INVALID_URL]: Invalid URL 

Relevant place:

const urlParts = new URL(req.url)

It's not possible to parse the URL like this. We need to do:

new URL(request.url, `http://${request.headers.host}`);

https://nodejs.org/api/http.html#messageurl

@StarpTech
Copy link
Author

@berstend is it realistic to expect a fix this week, or should I maintain a fork?

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

1 participant