mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-28 01:25:39 -05:00
Merge from vscode e3c4990c67c40213af168300d1cfeb71d680f877 (#16569)
This commit is contained in:
@@ -11,23 +11,3 @@ export interface WebviewResourceProvider {
|
||||
readonly cspSource: string;
|
||||
}
|
||||
|
||||
export function normalizeResource(
|
||||
base: vscode.Uri,
|
||||
resource: vscode.Uri
|
||||
): vscode.Uri {
|
||||
// If we have a windows path and are loading a workspace with an authority,
|
||||
// make sure we use a unc path with an explicit localhost authority.
|
||||
//
|
||||
// Otherwise, the `<base>` rule will insert the authority into the resolved resource
|
||||
// URI incorrectly.
|
||||
if (base.authority && !resource.authority) {
|
||||
const driveMatch = resource.path.match(/^\/(\w):\//);
|
||||
if (driveMatch) {
|
||||
return vscode.Uri.file(`\\\\localhost\\${driveMatch[1]}$\\${resource.fsPath.replace(/^\w:\\/, '')}`).with({
|
||||
fragment: resource.fragment,
|
||||
query: resource.query
|
||||
});
|
||||
}
|
||||
}
|
||||
return resource;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user