No longer use HEAD requests, which are handled oddly in Safari on iOS

This commit is contained in:
Zef Hemel
2023-07-10 13:06:57 +02:00
parent 3be4c9fc34
commit 2ae538a5e5
2 changed files with 20 additions and 8 deletions
+16 -4
View File
@@ -20,15 +20,27 @@ export class FallbackSpacePrimitives implements SpacePrimitives {
async readFile(name: string): Promise<{ data: Uint8Array; meta: FileMeta }> {
try {
return await this.primary.readFile(name);
} catch {
return this.fallback.readFile(name);
} catch (e) {
try {
return this.fallback.readFile(name);
} catch (fallbackError) {
console.error("Error during reaFile fallback", fallbackError);
// Fallback failed, so let's throw the original error
throw e;
}
}
}
async getFileMeta(name: string): Promise<FileMeta> {
try {
return await this.primary.getFileMeta(name);
} catch {
return this.fallback.getFileMeta(name);
} catch (e) {
try {
return this.fallback.getFileMeta(name);
} catch (fallbackError) {
console.error("Error during getFileMeta fallback", fallbackError);
// Fallback failed, so let's throw the original error
throw e;
}
}
}
writeFile(