szmarczak / http2-wrapper

Use HTTP/2 the same way like HTTP/1
MIT License
240 stars 18 forks source link

`ClientRequest` incorrectly guesses the request origin #37

Closed szmarczak closed 4 years ago

szmarczak commented 4 years ago

https://github.com/szmarczak/http2-wrapper/blob/03f0b154c474e5766b055d5d6bb307af33ae97b1/source/client-request.js#L114

As you can see the port is always visible, while it shouldn't e.g. https://google.com:443.

This is one of the right ways to normalize it (the following is very slow):

https://github.com/szmarczak/http2-wrapper/blob/03f0b154c474e5766b055d5d6bb307af33ae97b1/source/agent.js#L163-L173