mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-16 03:31:10 +00:00
fix: handle leading-dot NO_PROXY entries matching apex domain
`.slack.com` in NO_PROXY should match both `slack.com` (apex) and `wss-primary.slack.com` (subdomain). Strip the leading dot before comparison so the suffix check works for both cases.
This commit is contained in:
committed by
Peter Steinberger
parent
4ab6a7b324
commit
5609a35f67
@@ -31,8 +31,10 @@ function isHostExcludedByNoProxy(
|
||||
if (entry === "*") {
|
||||
return true;
|
||||
}
|
||||
// Exact match or suffix match (with leading dot)
|
||||
if (lower === entry || lower.endsWith(entry.startsWith(".") ? entry : `.${entry}`)) {
|
||||
// Strip optional leading dot for comparison so `.slack.com` matches both
|
||||
// `slack.com` (apex) and `wss-primary.slack.com` (subdomain).
|
||||
const bare = entry.startsWith(".") ? entry.slice(1) : entry;
|
||||
if (lower === bare || lower.endsWith(`.${bare}`)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user