Skip to content

Commit 56a544b

Browse files
jeanp413mjbvz
authored andcommitted
Don't encode image resource URI twice (microsoft#85355)
1 parent 84aa1ad commit 56a544b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

extensions/image-preview/src/preview.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@ class Preview extends Disposable implements vscode.WebviewEditorEditingCapabilit
240240
default:
241241
// Avoid adding cache busting if there is already a query string
242242
if (resource.query) {
243-
return encodeURI(webviewEditor.webview.asWebviewUri(resource).toString(true));
243+
return webviewEditor.webview.asWebviewUri(resource).toString(true);
244244
}
245-
return encodeURI(webviewEditor.webview.asWebviewUri(resource).toString(true) + `?version=${version}`);
245+
return webviewEditor.webview.asWebviewUri(resource).with({ query: `version=${version}` }).toString(true);
246246
}
247247
}
248248

0 commit comments

Comments
 (0)