未验证 提交 cc6f165f 编写于 作者: N Ng Yik Phang 提交者: GitHub

Use HTTPS for npm package.json auto-complete

Fixes https://github.com/Microsoft/vscode/issues/41511
上级 26266020
...@@ -212,7 +212,7 @@ export class PackageJSONContribution implements IJSONContribution { ...@@ -212,7 +212,7 @@ export class PackageJSONContribution implements IJSONContribution {
if ((location.matches(['dependencies', '*']) || location.matches(['devDependencies', '*']) || location.matches(['optionalDependencies', '*']) || location.matches(['peerDependencies', '*']))) { if ((location.matches(['dependencies', '*']) || location.matches(['devDependencies', '*']) || location.matches(['optionalDependencies', '*']) || location.matches(['peerDependencies', '*']))) {
const currentKey = location.path[location.path.length - 1]; const currentKey = location.path[location.path.length - 1];
if (typeof currentKey === 'string') { 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({ return this.xhr({
url: queryUrl, url: queryUrl,
agent: USER_AGENT agent: USER_AGENT
...@@ -272,7 +272,7 @@ export class PackageJSONContribution implements IJSONContribution { ...@@ -272,7 +272,7 @@ export class PackageJSONContribution implements IJSONContribution {
private getInfo(pack: string): Thenable<string[]> { 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({ return this.xhr({
url: queryUrl, url: queryUrl,
agent: USER_AGENT agent: USER_AGENT
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册