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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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