Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Setting pathname had no effect

Manav Rathic988884ab1b5
diff --git a/web/apps/photos/src/utils/native-stream.ts b/web/apps/photos/src/utils/native-stream.ts
index a910d3b228..b20cb9290a 100644
--- a/web/apps/photos/src/utils/native-stream.ts
+++ b/web/apps/photos/src/utils/native-stream.ts
@@ -39,12 +39,10 @@ export const readStream = async (
): Promise<{ response: Response; size: number; lastModifiedMs: number }> => {
let url: URL;
if (typeof pathOrZipItem == "string") {
- url = new URL("stream://read");
- url.pathname = pathOrZipItem
+ url = new URL(`stream://read${encodeURIComponent(pathOrZipItem)}`);
} else {
const [zipPath, entryName] = pathOrZipItem;
- url = new URL("stream://read-zip");
- url.pathname = zipPath;
+ url = new URL(`stream://read-zip${encodeURIComponent(zipPath)}`);
url.hash = entryName;
}