mirror of
https://github.com/actions/runner.git
synced 2025-12-12 05:37:01 +00:00
Bypass all proxies for all hosts if no_proxy='*' is set (#2395)
* Bypass top level domain even if no_proxy specified it with leading '.' E.g. no_proxy='.github.com' will now bypass github.com. * Bypass proxy on all hosts when no_proxy is * (wildcard) * Undo '.' stripping * Simplify unit tests * Respect wildcard even if it's one of many no_proxy items
This commit is contained in:
@@ -164,7 +164,6 @@ namespace GitHub.Runner.Sdk
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
_noProxyList.Add(noProxyInfo);
|
||||
}
|
||||
}
|
||||
@@ -207,6 +206,11 @@ namespace GitHub.Runner.Sdk
|
||||
{
|
||||
foreach (var noProxy in _noProxyList)
|
||||
{
|
||||
// bypass on wildcard no_proxy
|
||||
if (string.Equals(noProxy.Host, "*", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
var matchHost = false;
|
||||
var matchPort = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user