mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-01 18:23:16 +08:00
Standardize behaviour of no_proxy environmental variable (#1223)
* match no_proxy to subdomains
* strip leading dot + '*' match all + testcases
* Update proxy.test.ts
* Revert "Update proxy.test.ts"
This reverts commit 0e925a6dc5.
* remove support for leading dots and wildcard no_proxy
* change order of tests for logic consistency
* add test for working leading dot
* add check for partial domain, as opposed to subdomain
This commit is contained in:
@@ -51,7 +51,15 @@ export function checkBypass(reqUrl: URL): boolean {
|
||||
.split(',')
|
||||
.map(x => x.trim().toUpperCase())
|
||||
.filter(x => x)) {
|
||||
if (upperReqHosts.some(x => x === upperNoProxyItem)) {
|
||||
if (
|
||||
upperReqHosts.some(
|
||||
x =>
|
||||
x === upperNoProxyItem ||
|
||||
x.endsWith(`.${upperNoProxyItem}`) ||
|
||||
(upperNoProxyItem.startsWith('.') &&
|
||||
x.endsWith(`${upperNoProxyItem}`))
|
||||
)
|
||||
) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user