fix(DnsPinMiddleware): Don't log misleading port value / log request port instead#50583
Open
joshtrichards wants to merge 2 commits intomasterfrom
Open
fix(DnsPinMiddleware): Don't log misleading port value / log request port instead#50583joshtrichards wants to merge 2 commits intomasterfrom
joshtrichards wants to merge 2 commits intomasterfrom
Conversation
Signed-off-by: Josh <[email protected]>
Signed-off-by: Josh <[email protected]>
Member
Author
|
/backport to stable31 |
Member
Author
|
/backport to stable30 |
Member
Author
|
/backport to stable29 |
Collaborator
|
I think it makes sense to do what's in your "P.S.": check IP addresses first and populates curl options later. |
This was referenced Aug 22, 2025
Merged
Merged
Merged
Merged
Merged
This was referenced Sep 25, 2025
Merged
Merged
Merged
Merged
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.
Summary
#43650 added logging of the host that triggers the
LocalServerException. It also added theportto that log output.However the logged port is misleading and logging it does not make sense in this context because... it's not the actual port specified in the request.
The
porthere is merely the one that happens to be the current one in theforeachiterator when the IP in question triggersisLocalAddress($ip)to be true. (We check a list of ports that is essentially {requestPort + 80 + 443}. Ultimately that'll be80every time which, again, has nothing to do with the current request.So either don't log any port or, since we do have the request port, go ahead and log it for the admin since it's more relevant.
P.S. Hmm. Actually upon reflection I think we can probably just move the entire
foreach ($ports as $port) {below theisLocalAddress()check too. The ports list is only used for properly populating theCURLOPT_RESOLVE. The ports themselves are not used for the check itself so no reason to run the check within the port combo iterator.server/lib/private/Http/Client/DnsPinMiddleware.php
Lines 132 to 133 in a1be491
TODO
Checklist