Fix zip reader

This commit is contained in:
Manav Rathi 2024-05-01 10:17:51 +05:30
parent bd2969daff
commit 38969d6f45
No known key found for this signature in database
2 changed files with 3 additions and 2 deletions

View file

@ -48,7 +48,8 @@ export const registerStreamProtocol = () => {
const { host, pathname, hash } = new URL(url);
// Convert e.g. "%20" to spaces.
const path = decodeURIComponent(pathname);
const hashPath = decodeURIComponent(hash);
// `hash` begins with a "#", slice that off.
const hashPath = decodeURIComponent(hash.slice(1));
switch (host) {
case "read":
return handleRead(path);

View file

@ -42,7 +42,7 @@ export const readStream = async (
url = new URL(`stream://read${pathOrZipItem}`);
} else {
const [zipPath, entryName] = pathOrZipItem;
url = new URL(`stream://read${zipPath}`);
url = new URL(`stream://read-zip${zipPath}`);
url.hash = entryName;
}