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.
Version
v22.12.0 (and probably more)
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/foobecomeshttp://localhost/fooIf 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/foobecomeshttp://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.