let onedrive download happy with native fetch and no cache

This commit is contained in:
fyears 2024-06-14 23:56:15 +08:00
parent 5ed6fec6e9
commit 157eff3a61

View File

@ -913,7 +913,8 @@ export class FakeFsOnedrive extends FakeFs {
`${key}?$select=@microsoft.graph.downloadUrl` `${key}?$select=@microsoft.graph.downloadUrl`
); );
const downloadUrl: string = rsp["@microsoft.graph.downloadUrl"]; const downloadUrl: string = rsp["@microsoft.graph.downloadUrl"];
if (VALID_REQURL) { // biome-ignore lint/correctness/noConstantCondition: <explanation>
if (false /*VALID_REQURL*/) {
const content = ( const content = (
await requestUrl({ await requestUrl({
url: downloadUrl, url: downloadUrl,
@ -923,7 +924,9 @@ export class FakeFsOnedrive extends FakeFs {
return content; return content;
} else { } else {
// cannot set no-cache here, will have cors error // cannot set no-cache here, will have cors error
const content = await (await fetch(downloadUrl)).arrayBuffer(); const content = await (
await fetch(downloadUrl, { cache: "no-store" })
).arrayBuffer();
return content; return content;
} }
} }