straightforward icon indicating copy to clipboard operation
straightforward copied to clipboard

TypeError [ERR_INVALID_URL]: Invalid URL

Open StarpTech opened this issue 2 years ago • 1 comments

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: https://github.com/berstend/straightforward/blob/84a4cb88024cffce37a05870da7d9d0aba7dcca8/src/Straightforward.ts#L295

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 avatar Apr 24 '23 17:04 StarpTech

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

StarpTech avatar Apr 25 '23 20:04 StarpTech