Closed jerry4718 closed 8 hours ago
Hi, I investigated this issue and also compared with how node
implements it. The problem is when the host
field is specified the the port
number is still be added to the string. But, host should already have the port number. Hence, a check can be done before port number is added to the string based on whether the host
is defined or not and it should fix this issue.
I have a pr to fix this https://github.com/denoland/deno/pull/18258
Hi, I investigated this issue and also compared with how
node
implements it. The problem is when thehost
field is specified the theport
number is still be added to the string. But, host should already have the port number. Hence, a check can be done before port number is added to the string based on whether thehost
is defined or not and it should fix this issue.I have a pr to fix this #18258
During my testing of node:http
, I found that its original implementation was that opts.hostname
should have a higher priority than opts.host
, and the priority of opts.port
should also be higher than the :port
existing in opts.host
.
It looks like this issue is already fixes as part of https://github.com/denoland/deno/commit/867a6d303285cdffd060e6bb4b0e97de73925cfe (which is available since v1.34). Please check the behavior again with the latest Deno when you have time
It can be executed normally in nodejs, But such an error will be thrown in deno:
I found that
http://192.168.0.2:8080:8080/test
was created by ClientRequest._createUrlStrFromOptions