mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-01 18:23:16 +08:00
Prepend http:// to http(s)_proxy env if missing (#1439)
* Prepend http:// to http(s)_proxy env if missing * Formatting * Fix linting
This commit is contained in:
@@ -14,7 +14,12 @@ export function getProxyUrl(reqUrl: URL): URL | undefined {
|
||||
})()
|
||||
|
||||
if (proxyVar) {
|
||||
return new URL(proxyVar)
|
||||
try {
|
||||
return new URL(proxyVar)
|
||||
} catch {
|
||||
if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))
|
||||
return new URL(`http://${proxyVar}`)
|
||||
}
|
||||
} else {
|
||||
return undefined
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user