Restore old style vscode-resouce rewriting
For https://github.com/mhutchie/vscode-git-graph/issues/305 This was removed when switching over to the `vscode-webview-resource` since it handles the rewritting on the html input instead of for each request
This commit is contained in:
parent
1ef3656f76
commit
8e45a2f4b5
|
@ -124,12 +124,18 @@ function normalizeRequestPath(requestUri: URI) {
|
|||
fragment: requestUri.fragment
|
||||
});
|
||||
} else if (requestUri.scheme === Schemas.oldVscodeWebviewResource) {
|
||||
// The `vscode-resource` puts the scheme as the authority
|
||||
const resourceUri = URI.parse(`${requestUri.authority}:${encodeURIComponent(requestUri.path).replace(/%2F/g, '/')}`);
|
||||
return resourceUri.with({
|
||||
query: requestUri.query,
|
||||
fragment: requestUri.fragment
|
||||
});
|
||||
// Modern `vscode-resource` uris puts the scheme as the authority
|
||||
if (requestUri.authority) {
|
||||
const resourceUri = URI.parse(`${requestUri.authority}:${encodeURIComponent(requestUri.path).replace(/%2F/g, '/')}`);
|
||||
return resourceUri.with({
|
||||
query: requestUri.query,
|
||||
fragment: requestUri.fragment
|
||||
});
|
||||
}
|
||||
|
||||
// Old style vscode-resource uris lose the scheme of the resource which means they are unable to
|
||||
// load a mix of local and remote content properly.
|
||||
return requestUri.with({ scheme: 'file' });
|
||||
} else {
|
||||
return requestUri;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue