mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode e558dc6ea73a75bd69d7a0b485f0e7e4194c66bf (#6864)
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { ResolvedAuthority, IRemoteAuthorityResolverService, ResolverResult } from 'vs/platform/remote/common/remoteAuthorityResolver';
|
||||
import { RemoteAuthorities } from 'vs/base/common/network';
|
||||
|
||||
export class RemoteAuthorityResolverService implements IRemoteAuthorityResolverService {
|
||||
|
||||
@@ -15,13 +16,14 @@ export class RemoteAuthorityResolverService implements IRemoteAuthorityResolverS
|
||||
resolveAuthority(authority: string): Promise<ResolverResult> {
|
||||
if (authority.indexOf(':') >= 0) {
|
||||
const pieces = authority.split(':');
|
||||
return Promise.resolve({
|
||||
authority: { authority, host: pieces[0], port: parseInt(pieces[1], 10) }
|
||||
});
|
||||
return Promise.resolve(this._createResolvedAuthority(authority, pieces[0], parseInt(pieces[1], 10)));
|
||||
}
|
||||
return Promise.resolve({
|
||||
authority: { authority, host: authority, port: 80 }
|
||||
});
|
||||
return Promise.resolve(this._createResolvedAuthority(authority, authority, 80));
|
||||
}
|
||||
|
||||
private _createResolvedAuthority(authority: string, host: string, port: number): ResolverResult {
|
||||
RemoteAuthorities.set(authority, host, port);
|
||||
return { authority: { authority, host, port } };
|
||||
}
|
||||
|
||||
clearResolvedAuthority(authority: string): void {
|
||||
|
||||
Reference in New Issue
Block a user