mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Fix webview special paths for resources and re-enable test
Fixes #103419
This commit is contained in:
parent
9d72fcb0ae
commit
7493065766
|
@ -272,12 +272,18 @@ suite('vscode API - webview', () => {
|
|||
const response = await sendRecieveMessage(webview, { src: imagePath.toString() });
|
||||
assert.strictEqual(response.value, true);
|
||||
}
|
||||
// {
|
||||
// // #102188. Resource filename containing special characters like '%', '#', '?'.
|
||||
// const imagePath = webview.webview.asWebviewUri(workspaceFile('image%02.png'));
|
||||
// const response = await sendRecieveMessage(webview, { src: imagePath.toString() });
|
||||
// assert.strictEqual(response.value, true);
|
||||
// }
|
||||
{
|
||||
// #102188. Resource filename containing special characters like '%', '#', '?'.
|
||||
const imagePath = webview.webview.asWebviewUri(workspaceFile('image%02.png'));
|
||||
const response = await sendRecieveMessage(webview, { src: imagePath.toString() });
|
||||
assert.strictEqual(response.value, true);
|
||||
}
|
||||
{
|
||||
// #102188. Resource filename containing special characters like '%', '#', '?'.
|
||||
const imagePath = webview.webview.asWebviewUri(workspaceFile('image%.png'));
|
||||
const response = await sendRecieveMessage(webview, { src: imagePath.toString() });
|
||||
assert.strictEqual(response.value, true);
|
||||
}
|
||||
{
|
||||
const imagePath = webview.webview.asWebviewUri(workspaceFile('no-such-image.png'));
|
||||
const response = await sendRecieveMessage(webview, { src: imagePath.toString() });
|
||||
|
|
BIN
extensions/vscode-api-tests/testWorkspace/image%.png
Normal file
BIN
extensions/vscode-api-tests/testWorkspace/image%.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
|
@ -154,7 +154,7 @@ export class IFrameWebview extends BaseWebview<HTMLIFrameElement> implements Web
|
|||
authority: extensionLocation.authority,
|
||||
path: '/vscode-resource',
|
||||
query: JSON.stringify({
|
||||
requestResourcePath: uri.path
|
||||
requestResourcePath: encodeURIComponent(uri.path).replace(/%2F/g, '/').replace(/%25/g, '%')
|
||||
})
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue