electron-builder-http
Advanced tools
Comparing version 15.5.0 to 15.5.1
@@ -127,3 +127,4 @@ "use strict"; | ||
} | ||
this.doApiRequest(Object.assign({}, removeAuthHeader(options), (0, (_url || _load_url()).parse)(redirectUrl)), cancellationToken, requestProcessor, redirectCount).then(resolve).catch(reject); | ||
const newUrl = (0, (_url || _load_url()).parse)(redirectUrl); | ||
this.doApiRequest(removeAuthHeader(Object.assign({}, options, newUrl)), cancellationToken, requestProcessor, redirectCount).then(resolve).catch(reject); | ||
return; | ||
@@ -167,7 +168,7 @@ } | ||
const parsedUrl = (0, (_url || _load_url()).parse)(redirectUrl); | ||
this.doDownload(Object.assign({}, removeAuthHeader(requestOptions), { | ||
this.doDownload(removeAuthHeader(Object.assign({}, requestOptions, { | ||
hostname: parsedUrl.hostname, | ||
path: parsedUrl.path, | ||
port: parsedUrl.port == null ? undefined : parsedUrl.port | ||
}), destination, redirectCount++, options, callback, onCancel); | ||
})), destination, redirectCount++, options, callback, onCancel); | ||
} else { | ||
@@ -293,12 +294,12 @@ callback(new Error(`Too many redirects (> ${this.maxRedirects})`)); | ||
} | ||
// requestOptions should be cloned already, modified in place | ||
function removeAuthHeader(requestOptions) { | ||
const result = Object.assign({}, requestOptions); | ||
// github redirect to amazon s3 - avoid error "Only one auth mechanism allowed" | ||
if (result.headers != null) { | ||
result.headers = Object.assign({}, result.headers); | ||
delete result.headers.Authorization; | ||
delete result.headers.authorization; | ||
if (requestOptions.headers != null && (requestOptions.hostname || "").indexOf(".amazonaws.") !== -1) { | ||
requestOptions.headers = Object.assign({}, requestOptions.headers); | ||
delete requestOptions.headers.Authorization; | ||
delete requestOptions.headers.authorization; | ||
} | ||
return result; | ||
return requestOptions; | ||
} | ||
//# sourceMappingURL=httpExecutor.js.map |
{ | ||
"name": "electron-builder-http", | ||
"version": "15.5.0", | ||
"version": "15.5.1", | ||
"main": "out/httpExecutor.js", | ||
@@ -5,0 +5,0 @@ "author": "Vladimir Krivosheev", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70570
775