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:
Lewis Sanchez
2021-11-11 11:04:00 -08:00
committed by GitHub
parent ba92694fa3
commit 56a697c887

View File

@@ -94,6 +94,8 @@ export namespace Schemas {
}
class RemoteAuthoritiesImpl {
private readonly _defaultWebPort = 80; // {{SQL CARBON EDIT}}
private readonly _hosts: { [authority: string]: string | undefined; } = Object.create(null);
private readonly _ports: { [authority: string]: number | undefined; } = Object.create(null);
private readonly _connectionTokens: { [authority: string]: string | undefined; } = Object.create(null);
@@ -134,7 +136,7 @@ class RemoteAuthoritiesImpl {
}
return URI.from({
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`,
query
});