Do not configure proxyAuth when no proxy authentication is provided

This commit is contained in:
Pavan Ravipati
2021-03-23 15:25:35 -07:00
committed by GitHub
parent 9dc40793b9
commit e3934bd2d3

View File

@@ -642,7 +642,7 @@ export class HttpClient {
maxSockets: maxSockets, maxSockets: maxSockets,
keepAlive: this._keepAlive, keepAlive: this._keepAlive,
proxy: { proxy: {
proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`, ...((proxyUrl.username || proxyUrl.password) && { proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` }),
host: proxyUrl.hostname, host: proxyUrl.hostname,
port: proxyUrl.port port: proxyUrl.port
} }