Skip to content

Commit c3a7a6d

Browse files
committed
Fixed
- Fixed to correctly ignore cache when fetching TOC.
1 parent a59ea61 commit c3a7a6d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/StorageAccessor/S3Bucket.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class S3Bucket extends StorageAccessor {
7070
const result = await client.getObject({
7171
Bucket: this.settings.bucket,
7272
Key: fullPath,
73-
IfNoneMatch: preventCache ? "*" : undefined,
73+
ResponseCacheControl: preventCache ? "no-cache" : undefined
7474
});
7575
if (!result.Body) return false;
7676
const resultByteArray = await result.Body.transformToByteArray() as Uint8Array<ArrayBuffer>;

src/StorageAccessor/StorageAccessor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ export abstract class StorageAccessor {
4040
return (await this.checkType(path)) != FileType.Missing;
4141
}
4242

43-
async readBinary(path: string): Promise<ArrayBuffer | false> {
44-
const encryptedData = await this._readBinary(path);
43+
async readBinary(path: string, preventUseCache = false): Promise<ArrayBuffer | false> {
44+
const encryptedData = await this._readBinary(path, preventUseCache);
4545
if (encryptedData === false) return false;
4646
if (!this.isLocal && this.settings.passphraseOfZip) {
4747
return toArrayBuffer(await decryptCompatOpenSSL(new Uint8Array(encryptedData), this.settings.passphraseOfZip, 10000) as Uint8Array<ArrayBuffer>);
@@ -50,7 +50,7 @@ export abstract class StorageAccessor {
5050
}
5151

5252
async readTOC(path: string): Promise<ArrayBuffer | false> {
53-
if (this.type != "normal") return await this.readBinary(path);
53+
if (this.type != "normal") return await this.readBinary(path, true);
5454
return await this._readBinary(path, true);
5555
}
5656

0 commit comments

Comments
 (0)