Setting pathname had no effect

This commit is contained in:
Manav Rathi 2024-05-01 17:56:46 +05:30
parent b967d4bbea
commit c988884ab1
No known key found for this signature in database

View file

@ -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;
}