-
Notifications
You must be signed in to change notification settings - Fork 170
LOG-9383: Document NO_PROXY domain matching behavior difference between Vector and Go #3281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
vparfonov
wants to merge
1
commit into
openshift:master
Choose a base branch
from
vparfonov:log9383
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
Rust no-proxy crate NO_PROXY domain matching behavior for plain domains💡 Result:
In the context of Rust crates that implement NO_PROXY parsing (such as the popular
no-proxycrate [1] or theNoProxyimplementation found inreqwest[2]), the matching behavior for plain domains is designed to be inclusive of subdomains. Specifically, for these implementations: 1. Domain Equivalence: A plain domain (e.g.,example.com) and its variant with a leading dot (e.g.,.example.com) are treated as equivalent [3][4][2]. 2. Subdomain Matching: Bothexample.comand.example.comwill match the domain itself as well as all of its subdomains (e.g.,sub.example.com,a.b.example.com) [3][4][2]. This behavior is consistent with common expectations forNO_PROXYhandling in many modern libraries, where the goal is to simplify configuration by ensuring that a single entry covers a domain and its entire hierarchy [3][2]. If you are using a specific crate, you can verify this behavior by checking its documentation forNoProxy::from_stringorNoProxy::from_env, which typically outlines these rules explicitly [3][4][2]. For example, theno-proxycrate documentation confirms that it parses and evaluates these configurations to match both the specified domain and its subdomains [1][5].Citations:
🌐 Web query:
Go httpproxy package NO_PROXY domain matching behavior for plain domains💡 Result:
In Go's
net/http(via thegolang.org/x/net/http/httpproxypackage), theNO_PROXYenvironment variable defines a comma-separated list of hosts that should be excluded from proxying [1][2]. The matching behavior for plain domain names is as follows: 1. Domain Matching: A plain domain name (e.g.,example.com) matches that specific domain and all of its subdomains [1][3]. For example,example.comwill match bothexample.comandsub.example.com[1][3]. 2. Leading Dot: If a domain name is specified with a leading dot (e.g.,.example.com), it matches subdomains only, not the domain itself [1][3]. For example,.example.commatchessub.example.combut does not matchexample.com[1][3]. 3. Implementation Detail: Internally, the package processes these rules by checking if the request host ends with the specified domain string [1][3]. If a domain is provided without a leading dot, the implementation effectively treats it as a match for the host itself or any host that has the specified domain as a suffix [1][3]. 4. Special Case: A single asterisk (*) in theNO_PROXYlist indicates that no proxying should be performed for any request [1][3]. It is important to note thatNO_PROXYmatching is performed against the host portion of the request URL [1][3]. The package does not perform DNS lookups to resolve hostnames to IP addresses when evaluating these rules [4]. If you need to exclude IP addresses, you should provide them directly or use CIDR notation, which the package also supports [1][5].Citations:
CRITICAL: The Rust
no-proxycrate behavior claim is incorrect.The comparison table states that Vector (using Rust
no-proxycrate) treats plain domains likeexample.comas exact-match-only, differing from Go's behavior. However, according to theno-proxycrate documentation,example.comand.example.comare treated as equivalent and both match the domain and all subdomains—identical to Go'shttpproxybehavior. This means the documented "Known Limitation" does not actually exist.The incorrect claim undermines the entire section and the workaround guidance (lines 203-220). If Vector and Go handle plain domains identically, the workaround may be unnecessary. Remove or correct this section based on actual library behavior verification.
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vparfonov if this is correct then that means there is either a documentation error in the crate or an implementation error. Let's figure out which is correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upstream
no-proxycratev0.3.6File: src/lib.rs, line 111 in jdrouet/no-proxy
This is exact match only, no subdomain matching.
So "Known Limitation" is correct at the moment