mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Resolves same-origin-policy violation when ADS web is running in a container (#17555)
* Stops appending port to authority for web mode * Clarifies comment * Adds missing sql carbon edit tag
This commit is contained in:
@@ -94,6 +94,8 @@ export namespace Schemas {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class RemoteAuthoritiesImpl {
|
class RemoteAuthoritiesImpl {
|
||||||
|
private readonly _defaultWebPort = 80; // {{SQL CARBON EDIT}}
|
||||||
|
|
||||||
private readonly _hosts: { [authority: string]: string | undefined; } = Object.create(null);
|
private readonly _hosts: { [authority: string]: string | undefined; } = Object.create(null);
|
||||||
private readonly _ports: { [authority: string]: number | undefined; } = Object.create(null);
|
private readonly _ports: { [authority: string]: number | undefined; } = Object.create(null);
|
||||||
private readonly _connectionTokens: { [authority: string]: string | undefined; } = Object.create(null);
|
private readonly _connectionTokens: { [authority: string]: string | undefined; } = Object.create(null);
|
||||||
@@ -134,7 +136,7 @@ class RemoteAuthoritiesImpl {
|
|||||||
}
|
}
|
||||||
return URI.from({
|
return URI.from({
|
||||||
scheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,
|
scheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,
|
||||||
authority: `${host}:${port}`,
|
authority: platform.isWeb && port === this._defaultWebPort ? `${host}` : `${host}:${port}`, // {{SQL CARBON EDIT}} addresses same-origin-policy violation in web mode when port number is in authority, but not in URI.
|
||||||
path: `/vscode-remote-resource`,
|
path: `/vscode-remote-resource`,
|
||||||
query
|
query
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user