@theia/plugin-ext 1.74.0-next.17 → 1.74.0-next.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/main/node/plugin-http-resolver.d.ts.map +1 -1
- package/lib/main/node/plugin-http-resolver.js +5 -3
- package/lib/main/node/plugin-http-resolver.js.map +1 -1
- package/lib/main/node/plugin-http-resolver.spec.d.ts +2 -0
- package/lib/main/node/plugin-http-resolver.spec.d.ts.map +1 -0
- package/lib/main/node/plugin-http-resolver.spec.js +40 -0
- package/lib/main/node/plugin-http-resolver.spec.js.map +1 -0
- package/lib/main/node/plugin-service.d.ts.map +1 -1
- package/lib/main/node/plugin-service.js +8 -3
- package/lib/main/node/plugin-service.js.map +1 -1
- package/package.json +31 -31
- package/src/main/node/plugin-http-resolver.spec.ts +41 -0
- package/src/main/node/plugin-http-resolver.ts +4 -3
- package/src/main/node/plugin-service.ts +7 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-http-resolver.d.ts","sourceRoot":"","sources":["../../../src/main/node/plugin-http-resolver.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAkB,cAAc,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin-http-resolver.d.ts","sourceRoot":"","sources":["../../../src/main/node/plugin-http-resolver.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAkB,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAKnF,OAAO,EAAE,sBAAsB,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAGrF;;;;GAIG;AACH,qBACa,0BAA2B,YAAW,sBAAsB;IAErE,OAAO,CAAC,cAAc,CAAmB;IAGzC,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;;IAc3C;;OAEG;IACG,OAAO,CAAC,qBAAqB,EAAE,6BAA6B,GAAG,OAAO,CAAC,IAAI,CAAC;IAkClF;;OAEG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;CAGpC"}
|
|
@@ -22,7 +22,6 @@ const inversify_1 = require("@theia/core/shared/inversify");
|
|
|
22
22
|
const promise_util_1 = require("@theia/core/lib/common/promise-util");
|
|
23
23
|
const fs_1 = require("fs");
|
|
24
24
|
const path = require("path");
|
|
25
|
-
const url = require("url");
|
|
26
25
|
const temp_dir_util_1 = require("./temp-dir-util");
|
|
27
26
|
/**
|
|
28
27
|
* Resolver that handle the http(s): protocol
|
|
@@ -49,8 +48,11 @@ let HttpPluginDeployerResolver = class HttpPluginDeployerResolver {
|
|
|
49
48
|
// download the file
|
|
50
49
|
// keep filename of the url
|
|
51
50
|
const urlPath = pluginResolverContext.getOriginId();
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
let link;
|
|
52
|
+
try {
|
|
53
|
+
link = new URL(urlPath);
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
54
56
|
throw new Error('invalid link URI' + urlPath);
|
|
55
57
|
}
|
|
56
58
|
const dirname = path.dirname(link.pathname);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-http-resolver.js","sourceRoot":"","sources":["../../../src/main/node/plugin-http-resolver.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,+DAAmF;AACnF,4DAAkE;AAClE,sEAA+D;AAC/D,2BAAoC;AACpC,6BAA6B;
|
|
1
|
+
{"version":3,"file":"plugin-http-resolver.js","sourceRoot":"","sources":["../../../src/main/node/plugin-http-resolver.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;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|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-http-resolver.spec.d.ts","sourceRoot":"","sources":["../../../src/main/node/plugin-http-resolver.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2026 EclipseSource and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const chai_1 = require("chai");
|
|
19
|
+
const plugin_http_resolver_1 = require("./plugin-http-resolver");
|
|
20
|
+
describe('HttpPluginDeployerResolver', () => {
|
|
21
|
+
function createContext(originId) {
|
|
22
|
+
return {
|
|
23
|
+
getOriginId: () => originId
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
it('should reject a malformed link URI', async () => {
|
|
28
|
+
const resolver = new plugin_http_resolver_1.HttpPluginDeployerResolver();
|
|
29
|
+
let error;
|
|
30
|
+
try {
|
|
31
|
+
await resolver.resolve(createContext(':::not a url'));
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
error = e;
|
|
35
|
+
}
|
|
36
|
+
(0, chai_1.expect)(error).to.be.an.instanceOf(Error);
|
|
37
|
+
(0, chai_1.expect)(error.message).to.contain('invalid link URI');
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=plugin-http-resolver.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-http-resolver.spec.js","sourceRoot":"","sources":["../../../src/main/node/plugin-http-resolver.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,+BAA8B;AAC9B,iEAAoE;AAGpE,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAExC,SAAS,aAAa,CAAC,QAAgB;QACnC,OAAO;YACH,WAAW,EAAE,GAAG,EAAE,CAAC,QAAQ;YAC3B,8DAA8D;SACzB,CAAC;IAC9C,CAAC;IAED,EAAE,CAAC,oCAAoC,EAAE,KAAK,IAAI,EAAE;QAChD,MAAM,QAAQ,GAAG,IAAI,iDAA0B,EAAE,CAAC;QAClD,IAAI,KAAwB,CAAC;QAC7B,IAAI,CAAC;YACD,MAAM,QAAQ,CAAC,OAAO,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC;QAC1D,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACT,KAAK,GAAG,CAAU,CAAC;QACvB,CAAC;QACD,IAAA,aAAM,EAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACzC,IAAA,aAAM,EAAC,KAAM,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-service.d.ts","sourceRoot":"","sources":["../../../src/main/node/plugin-service.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin-service.d.ts","sourceRoot":"","sources":["../../../src/main/node/plugin-service.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAG7B,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,8BAA8B,EAAE,MAAM,0CAA0C,CAAC;AAI1F,OAAO,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,oDAAoD,CAAC;AAE1F,qBACa,qBAAsB,YAAW,8BAA8B,EAAE,8BAA8B;IAExG,SAAS,CAAC,6BAA6B,EAAE,MAAM,CAAC;IAEhD,SAAS,CAAC,eAAe,EAAE,OAAO,CAAS;IAG3C,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IAG1D,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,oBAAoB,CAAC;IAGvD,SAAS,CAAC,IAAI,IAAI,IAAI;IAMtB,SAAS,CAAC,GAAG,EAAE,OAAO,CAAC,WAAW,GAAG,IAAI;IAazC,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,GAAG,YAAY,CAAC,OAAO,CAAC;IAgBpE,SAAS,CAAC,8BAA8B,IAAI,MAAM;IAalD;;OAEG;IACH,SAAS,CAAC,uBAAuB,IAAI,MAAM;CAM9C"}
|
|
@@ -18,7 +18,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
exports.PluginApiContribution = void 0;
|
|
19
19
|
const tslib_1 = require("tslib");
|
|
20
20
|
const path = require("path");
|
|
21
|
-
const url = require("url");
|
|
22
21
|
const vhost = require('vhost');
|
|
23
22
|
const express = require("@theia/core/shared/express");
|
|
24
23
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
@@ -50,8 +49,14 @@ let PluginApiContribution = class PluginApiContribution {
|
|
|
50
49
|
}
|
|
51
50
|
allowWsUpgrade(request) {
|
|
52
51
|
if (request.headers.origin && !this.serveSameOrigin) {
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
let host;
|
|
53
|
+
try {
|
|
54
|
+
host = new URL(request.headers.origin).host;
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
host = undefined;
|
|
58
|
+
}
|
|
59
|
+
if (host && this.webviewExternalEndpointRegExp.test(host)) {
|
|
55
60
|
// If the origin comes from the WebViews, refuse:
|
|
56
61
|
return false;
|
|
57
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-service.js","sourceRoot":"","sources":["../../../src/main/node/plugin-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAGhF,6BAA6B;AAC7B,
|
|
1
|
+
{"version":3,"file":"plugin-service.js","sourceRoot":"","sources":["../../../src/main/node/plugin-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAGhF,6BAA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1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/plugin-ext",
|
|
3
|
-
"version": "1.74.0-next.
|
|
3
|
+
"version": "1.74.0-next.29+5ef180bee",
|
|
4
4
|
"description": "Theia - Plugin Extension",
|
|
5
5
|
"main": "lib/common/index.js",
|
|
6
6
|
"typings": "lib/common/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@theia/ai-core": "1.74.0-next.
|
|
9
|
-
"@theia/ai-mcp": "1.74.0-next.
|
|
10
|
-
"@theia/bulk-edit": "1.74.0-next.
|
|
11
|
-
"@theia/callhierarchy": "1.74.0-next.
|
|
12
|
-
"@theia/console": "1.74.0-next.
|
|
13
|
-
"@theia/core": "1.74.0-next.
|
|
14
|
-
"@theia/debug": "1.74.0-next.
|
|
15
|
-
"@theia/editor": "1.74.0-next.
|
|
16
|
-
"@theia/editor-preview": "1.74.0-next.
|
|
17
|
-
"@theia/file-search": "1.74.0-next.
|
|
18
|
-
"@theia/filesystem": "1.74.0-next.
|
|
19
|
-
"@theia/markers": "1.74.0-next.
|
|
20
|
-
"@theia/messages": "1.74.0-next.
|
|
21
|
-
"@theia/monaco": "1.74.0-next.
|
|
8
|
+
"@theia/ai-core": "1.74.0-next.29+5ef180bee",
|
|
9
|
+
"@theia/ai-mcp": "1.74.0-next.29+5ef180bee",
|
|
10
|
+
"@theia/bulk-edit": "1.74.0-next.29+5ef180bee",
|
|
11
|
+
"@theia/callhierarchy": "1.74.0-next.29+5ef180bee",
|
|
12
|
+
"@theia/console": "1.74.0-next.29+5ef180bee",
|
|
13
|
+
"@theia/core": "1.74.0-next.29+5ef180bee",
|
|
14
|
+
"@theia/debug": "1.74.0-next.29+5ef180bee",
|
|
15
|
+
"@theia/editor": "1.74.0-next.29+5ef180bee",
|
|
16
|
+
"@theia/editor-preview": "1.74.0-next.29+5ef180bee",
|
|
17
|
+
"@theia/file-search": "1.74.0-next.29+5ef180bee",
|
|
18
|
+
"@theia/filesystem": "1.74.0-next.29+5ef180bee",
|
|
19
|
+
"@theia/markers": "1.74.0-next.29+5ef180bee",
|
|
20
|
+
"@theia/messages": "1.74.0-next.29+5ef180bee",
|
|
21
|
+
"@theia/monaco": "1.74.0-next.29+5ef180bee",
|
|
22
22
|
"@theia/monaco-editor-core": "1.108.201",
|
|
23
|
-
"@theia/navigator": "1.74.0-next.
|
|
24
|
-
"@theia/notebook": "1.74.0-next.
|
|
25
|
-
"@theia/output": "1.74.0-next.
|
|
26
|
-
"@theia/plugin": "1.74.0-next.
|
|
27
|
-
"@theia/preferences": "1.74.0-next.
|
|
28
|
-
"@theia/scm": "1.74.0-next.
|
|
29
|
-
"@theia/search-in-workspace": "1.74.0-next.
|
|
30
|
-
"@theia/task": "1.74.0-next.
|
|
31
|
-
"@theia/terminal": "1.74.0-next.
|
|
32
|
-
"@theia/test": "1.74.0-next.
|
|
33
|
-
"@theia/timeline": "1.74.0-next.
|
|
34
|
-
"@theia/typehierarchy": "1.74.0-next.
|
|
35
|
-
"@theia/variable-resolver": "1.74.0-next.
|
|
36
|
-
"@theia/workspace": "1.74.0-next.
|
|
23
|
+
"@theia/navigator": "1.74.0-next.29+5ef180bee",
|
|
24
|
+
"@theia/notebook": "1.74.0-next.29+5ef180bee",
|
|
25
|
+
"@theia/output": "1.74.0-next.29+5ef180bee",
|
|
26
|
+
"@theia/plugin": "1.74.0-next.29+5ef180bee",
|
|
27
|
+
"@theia/preferences": "1.74.0-next.29+5ef180bee",
|
|
28
|
+
"@theia/scm": "1.74.0-next.29+5ef180bee",
|
|
29
|
+
"@theia/search-in-workspace": "1.74.0-next.29+5ef180bee",
|
|
30
|
+
"@theia/task": "1.74.0-next.29+5ef180bee",
|
|
31
|
+
"@theia/terminal": "1.74.0-next.29+5ef180bee",
|
|
32
|
+
"@theia/test": "1.74.0-next.29+5ef180bee",
|
|
33
|
+
"@theia/timeline": "1.74.0-next.29+5ef180bee",
|
|
34
|
+
"@theia/typehierarchy": "1.74.0-next.29+5ef180bee",
|
|
35
|
+
"@theia/variable-resolver": "1.74.0-next.29+5ef180bee",
|
|
36
|
+
"@theia/workspace": "1.74.0-next.29+5ef180bee",
|
|
37
37
|
"@types/mime": "^2.0.3",
|
|
38
38
|
"@vscode/debugprotocol": "^1.68.0",
|
|
39
39
|
"@vscode/proxy-agent": "^0.13.2",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"macaddress": "^0.5.4",
|
|
48
48
|
"mime": "^2.6.0",
|
|
49
49
|
"node-pty": "1.2.0-beta.12",
|
|
50
|
-
"semver": "^7.8.
|
|
50
|
+
"semver": "^7.8.5",
|
|
51
51
|
"tslib": "^2.8.1",
|
|
52
52
|
"vhost": "^3.0.2",
|
|
53
53
|
"vscode-textmate": "^9.3.2"
|
|
@@ -98,5 +98,5 @@
|
|
|
98
98
|
"nyc": {
|
|
99
99
|
"extends": "../../configs/nyc.json"
|
|
100
100
|
},
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "5ef180bee6397858bc244d20ca2f35fb1fa360ac"
|
|
102
102
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2026 EclipseSource and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { expect } from 'chai';
|
|
18
|
+
import { HttpPluginDeployerResolver } from './plugin-http-resolver';
|
|
19
|
+
import { PluginDeployerResolverContext } from '../../common';
|
|
20
|
+
|
|
21
|
+
describe('HttpPluginDeployerResolver', () => {
|
|
22
|
+
|
|
23
|
+
function createContext(originId: string): PluginDeployerResolverContext {
|
|
24
|
+
return {
|
|
25
|
+
getOriginId: () => originId
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
|
+
} as any as PluginDeployerResolverContext;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
it('should reject a malformed link URI', async () => {
|
|
31
|
+
const resolver = new HttpPluginDeployerResolver();
|
|
32
|
+
let error: Error | undefined;
|
|
33
|
+
try {
|
|
34
|
+
await resolver.resolve(createContext(':::not a url'));
|
|
35
|
+
} catch (e) {
|
|
36
|
+
error = e as Error;
|
|
37
|
+
}
|
|
38
|
+
expect(error).to.be.an.instanceOf(Error);
|
|
39
|
+
expect(error!.message).to.contain('invalid link URI');
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -19,7 +19,6 @@ import { inject, injectable } from '@theia/core/shared/inversify';
|
|
|
19
19
|
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
20
20
|
import { promises as fs } from 'fs';
|
|
21
21
|
import * as path from 'path';
|
|
22
|
-
import * as url from 'url';
|
|
23
22
|
import { PluginDeployerResolver, PluginDeployerResolverContext } from '../../common';
|
|
24
23
|
import { getTempDirPathAsync } from './temp-dir-util';
|
|
25
24
|
|
|
@@ -56,8 +55,10 @@ export class HttpPluginDeployerResolver implements PluginDeployerResolver {
|
|
|
56
55
|
// download the file
|
|
57
56
|
// keep filename of the url
|
|
58
57
|
const urlPath = pluginResolverContext.getOriginId();
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
let link: URL;
|
|
59
|
+
try {
|
|
60
|
+
link = new URL(urlPath);
|
|
61
|
+
} catch {
|
|
61
62
|
throw new Error('invalid link URI' + urlPath);
|
|
62
63
|
}
|
|
63
64
|
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
|
|
17
17
|
import * as http from 'http';
|
|
18
18
|
import * as path from 'path';
|
|
19
|
-
import * as url from 'url';
|
|
20
19
|
const vhost = require('vhost');
|
|
21
20
|
import * as express from '@theia/core/shared/express';
|
|
22
21
|
import { BackendApplicationContribution } from '@theia/core/lib/node/backend-application';
|
|
@@ -63,8 +62,13 @@ export class PluginApiContribution implements BackendApplicationContribution, Ws
|
|
|
63
62
|
|
|
64
63
|
allowWsUpgrade(request: http.IncomingMessage): MaybePromise<boolean> {
|
|
65
64
|
if (request.headers.origin && !this.serveSameOrigin) {
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
let host: string | undefined;
|
|
66
|
+
try {
|
|
67
|
+
host = new URL(request.headers.origin).host;
|
|
68
|
+
} catch {
|
|
69
|
+
host = undefined;
|
|
70
|
+
}
|
|
71
|
+
if (host && this.webviewExternalEndpointRegExp.test(host)) {
|
|
68
72
|
// If the origin comes from the WebViews, refuse:
|
|
69
73
|
return false;
|
|
70
74
|
}
|