mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-25 15:35:43 +01:00
Fixes #79496: Always go through the protocol handler
This commit is contained in:
@@ -49,6 +49,8 @@ export namespace Schemas {
|
||||
|
||||
export const vscodeRemote: string = 'vscode-remote';
|
||||
|
||||
export const vscodeRemoteResource: string = 'vscode-remote-resource';
|
||||
|
||||
export const userData: string = 'vscode-userdata';
|
||||
}
|
||||
|
||||
@@ -64,7 +66,7 @@ class RemoteAuthoritiesImpl {
|
||||
}
|
||||
|
||||
public set(authority: string, host: string, port: number): void {
|
||||
this._hosts[authority] = (host === 'localhost' ? '127.0.0.1' : host);
|
||||
this._hosts[authority] = host;
|
||||
this._ports[authority] = port;
|
||||
}
|
||||
|
||||
@@ -76,9 +78,8 @@ class RemoteAuthoritiesImpl {
|
||||
const host = this._hosts[authority];
|
||||
const port = this._ports[authority];
|
||||
const connectionToken = this._connectionTokens[authority];
|
||||
const scheme = (host === '127.0.0.1' ? Schemas.http : Schemas.vscodeRemote);
|
||||
return URI.from({
|
||||
scheme: scheme,
|
||||
scheme: Schemas.vscodeRemoteResource,
|
||||
authority: `${host}:${port}`,
|
||||
path: `/vscode-remote2`,
|
||||
query: `path=${encodeURIComponent(path)}&tkn=${encodeURIComponent(connectionToken)}`
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
|
||||
|
||||
<meta http-equiv="Content-Security-Policy"
|
||||
content="default-src 'none'; img-src 'self' https: data: blob: vscode-remote:; media-src 'none'; frame-src 'self' {{WEBVIEW_ENDPOINT}} https://*.vscode-webview-test.com; script-src 'self' https://az416426.vo.msecnd.net 'unsafe-eval' https:; style-src 'self' 'unsafe-inline'; connect-src 'self' ws: wss: https:; font-src 'self' blob: vscode-remote:;">
|
||||
content="default-src 'none'; img-src 'self' https: data: blob:; media-src 'none'; frame-src 'self' {{WEBVIEW_ENDPOINT}} https://*.vscode-webview-test.com; script-src 'self' https://az416426.vo.msecnd.net 'unsafe-eval' https:; style-src 'self' 'unsafe-inline'; connect-src 'self' ws: wss: https:; font-src 'self' blob:;">
|
||||
|
||||
<meta id="vscode-workbench-web-configuration" data-settings="{{WORKBENCH_WEB_CONGIGURATION}}">
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src 'self' https: data: blob: vscode-remote: http://127.0.0.1:*; media-src 'none'; frame-src 'self' https://*.vscode-webview-test.com; object-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; connect-src 'self' https:; font-src 'self' https: vscode-remote: http://127.0.0.1:*;">
|
||||
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src 'self' https: data: blob: vscode-remote-resource:; media-src 'none'; frame-src 'self' https://*.vscode-webview-test.com; object-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; connect-src 'self' https:; font-src 'self' https: vscode-remote-resource:;">
|
||||
</head>
|
||||
<body class="vs-dark" aria-label="">
|
||||
</body>
|
||||
|
||||
@@ -688,9 +688,9 @@ export class CodeApplication extends Disposable {
|
||||
}
|
||||
|
||||
private handleRemoteAuthorities(): void {
|
||||
protocol.registerHttpProtocol(Schemas.vscodeRemote, (request, callback) => {
|
||||
protocol.registerHttpProtocol(Schemas.vscodeRemoteResource, (request, callback) => {
|
||||
callback({
|
||||
url: request.url.replace(/^vscode-remote:/, 'http:'),
|
||||
url: request.url.replace(/^vscode-remote-resource:/, 'http:'),
|
||||
method: request.method
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user