fix: plain domain entries should match subdomains#12
Open
vparfonov wants to merge 1 commit into
Open
Conversation
A plain domain like `example.com` in the no_proxy list now matches both the domain itself and all subdomains (e.g. `sub.example.com`), aligning with Go's httpproxy, curl, Python, and Ruby conventions. Previously, `Plain` variant did exact string match only, which contradicted the GitLab NO_PROXY standardization proposal that this crate references. The leading-dot form `.example.com` continues to match subdomains only (not the domain itself), preserving a useful distinction.
Author
|
@jdrouet can you please take a look |
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
example.comnow match the domain itself and all subdomains (e.g.sub.example.com), aligning with Go's httpproxy, curl, Python, and Ruby conventionsplain_domain_matches_subdomainstestProblem
NoProxyItem::Plainperformed exact string comparison only:Self::Plain(source) => source == value, this meantno_proxy=apps.example.comwould not bypass the proxy forelasticsearch.apps.example.com, contradicting all majorNO_PROXYimplementations and the GitLab standardizationproposal which states: "Suffixes are always matched (e.g. example.com will match test.example.com)"
https://about.gitlab.com/blog/we-need-to-talk-no-proxy/
Fix
Should fix: #11