Use HTTPS for npm package.json auto-complete

Fixes https://github.com/Microsoft/vscode/issues/41511
This commit is contained in:
Ng Yik Phang
2018-01-12 14:41:59 +08:00
committed by GitHub
parent 262660203e
commit cc6f165f2d

View File

@@ -212,7 +212,7 @@ export class PackageJSONContribution implements IJSONContribution {
if ((location.matches(['dependencies', '*']) || location.matches(['devDependencies', '*']) || location.matches(['optionalDependencies', '*']) || location.matches(['peerDependencies', '*']))) {
const currentKey = location.path[location.path.length - 1];
if (typeof currentKey === 'string') {
const queryUrl = 'http://registry.npmjs.org/' + encodeURIComponent(currentKey).replace('%40', '@');
const queryUrl = 'https://registry.npmjs.org/' + encodeURIComponent(currentKey).replace('%40', '@');
return this.xhr({
url: queryUrl,
agent: USER_AGENT
@@ -272,7 +272,7 @@ export class PackageJSONContribution implements IJSONContribution {
private getInfo(pack: string): Thenable<string[]> {
const queryUrl = 'http://registry.npmjs.org/' + encodeURIComponent(pack).replace('%40', '@');
const queryUrl = 'https://registry.npmjs.org/' + encodeURIComponent(pack).replace('%40', '@');
return this.xhr({
url: queryUrl,
agent: USER_AGENT