Repository navigation
Description
Version
v22.12.0 (and probably more)
Platform
Applies regardless of the platform
Subsystem
perf_hooks
What steps will reproduce the bug?
I wrote a test in order to put together a tentative fix (which still requires some extra work): main...stefanobaghino:node:perf_hooks/fix-http-detail-url
How often does it reproduce? Is there a required condition?
It's deterministic.
What is the expected behavior? Why is that the expected behavior?
The URL should be presented as faithfully as possible, including the port and with the original path preserved.
What do you see instead?
If the call is unproxied, the port is missing from the URL field. E.g. http://localhost:3000/foo becomes http://localhost/foo
If the path is converted to absolute-form for proxying, it's appended in the rewritten form to the protocol and host fragments. E.g. http://localhost:3000/foo becomes http://localhosthttp://localhost:3000/foo.
Additional information
The missing port has been there since the code was first introduced, to the best of my understanding. For the URL in absolute-form appended to the protocol and host, I'm not entirely sure. I would be happy to keep working on the patch I shared above to add a test for behavior when using the proxied HTTP, provide it as a PR, and backport it to the extent to which it makes sense, if you believe that the approach makes sense.
Activity
github-actions commentedon Apr 19, 2026
This issue has been marked as stale due to 210 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.
stefanobaghino commentedon Apr 19, 2026
To the best of my understanding this is still a problem.
http: fix perf_hooks detail.req.url port and proxied path
http: fix perf_hooks detail.req.url port and proxied path
http: fix perf_hooks detail.req.url port and proxied path
http: fix perf_hooks detail.req.url port and proxied path
http: fix perf_hooks detail.req.url port and proxied path