http: fix perf_hooks detail.req.url port and proxied path#64311
Open
stefanobaghino wants to merge 1 commit into
Open
http: fix perf_hooks detail.req.url port and proxied path#64311stefanobaghino wants to merge 1 commit into
stefanobaghino wants to merge 1 commit into
Conversation
The perf_hooks HTTP client entry built the reported URL from the bare hostname, dropping non-default ports and IPv6 brackets, and appended the request path even after it had been rewritten to absolute-form for proxying, duplicating the protocol and authority. Report the connection authority captured at request creation and, for proxied requests, use the rewritten absolute-form target as-is. Fixes: nodejs#59625
Collaborator
|
Review requested:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
detail.req.urlreported onhttpperformance entries forHttpClientmisrepresents the request URL in two ways: the port is dropped when it is non-default (http://localhost:3000/foois reported ashttp://localhost/foo), and when the request path has been rewritten to absolute-form for HTTP proxying it is appended to the protocol and hostname again (http://localhosthttp://localhost:3000/foo).The URL is now built from the connection authority captured at request creation (which carries the non-default port and IPv6 brackets, same as the auto-generated Host header), and when the path has been rewritten to absolute-form for proxying it is reported as-is, since it is already the full normalized URL.
Fixes: #59625