Skip to content

Commit 5585c20

Browse files
committed
fix: snapshot browser can download paths conaining spaces and special chars
1 parent b9181dc commit 5585c20

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

webui/src/components/SnapshotBrowser.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,15 @@ const FileNode = ({
231231
backrestService
232232
.getDownloadURL({ value: snapshotOpId })
233233
.then((resp) => {
234-
window.open(resp.value + entry.path, "_blank");
234+
const encodePathKeepSlashes = (p: string) =>
235+
p
236+
.split("/")
237+
.map((seg) => encodeURIComponent(seg))
238+
.join("/");
239+
window.open(
240+
resp.value + encodePathKeepSlashes(entry.path!),
241+
"_blank"
242+
);
235243
})
236244
.catch((e) => {
237245
alert("Failed to fetch download URL: " + e.message);

0 commit comments

Comments
 (0)