Skip to content

Commit 6cbef87

Browse files
Merge pull request #932 from OmniSharp/master
Merge fix for #930 into release
2 parents 5f817ff + 3e996e3 commit 6cbef87

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/packages.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ function getNoopStatus(): Status {
128128
};
129129
}
130130

131-
function downloadPackage(pkg: Package, logger: Logger, status?: Status, proxy?: string, strictSSL?: boolean): Promise<void> {
131+
function downloadPackage(pkg: Package, logger: Logger, status: Status, proxy: string, strictSSL: boolean): Promise<void> {
132132
status = status || getNoopStatus();
133133

134134
logger.append(`Downloading package '${pkg.description}' `);
@@ -147,12 +147,12 @@ function downloadPackage(pkg: Package, logger: Logger, status?: Status, proxy?:
147147
}).then(tmpResult => {
148148
pkg.tmpFile = tmpResult;
149149

150-
return downloadFile(pkg.url, pkg, logger, status)
150+
return downloadFile(pkg.url, pkg, logger, status, proxy, strictSSL)
151151
.then(() => logger.appendLine(' Done!'));
152152
});
153153
}
154154

155-
function downloadFile(urlString: string, pkg: Package, logger: Logger, status: Status, proxy?: string, strictSSL?: boolean): Promise<void> {
155+
function downloadFile(urlString: string, pkg: Package, logger: Logger, status: Status, proxy: string, strictSSL: boolean): Promise<void> {
156156
const url = parseUrl(urlString);
157157

158158
const options: https.RequestOptions = {
@@ -169,7 +169,7 @@ function downloadFile(urlString: string, pkg: Package, logger: Logger, status: S
169169
let request = https.request(options, response => {
170170
if (response.statusCode === 301 || response.statusCode === 302) {
171171
// Redirect - download from new location
172-
return resolve(downloadFile(response.headers.location, pkg, logger, status));
172+
return resolve(downloadFile(response.headers.location, pkg, logger, status, proxy, strictSSL));
173173
}
174174

175175
if (response.statusCode != 200) {

src/proxy.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function getSystemProxyURL(requestURL: Url): string {
1919
return null;
2020
}
2121

22-
export function getProxyAgent(requestURL: Url, proxy?: string, strictSSL?: boolean): any {
22+
export function getProxyAgent(requestURL: Url, proxy: string, strictSSL: boolean): any {
2323
const proxyURL = proxy || getSystemProxyURL(requestURL);
2424

2525
if (!proxyURL) {
@@ -32,7 +32,9 @@ export function getProxyAgent(requestURL: Url, proxy?: string, strictSSL?: boole
3232
return null;
3333
}
3434

35-
strictSSL = strictSSL || true;
35+
if (strictSSL === undefined) {
36+
strictSSL = true;
37+
}
3638

3739
const opts = {
3840
host: proxyEndpoint.hostname,

0 commit comments

Comments
 (0)