mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
don't disable cache for media repository downloads
This commit is contained in:
parent
cbd48aa528
commit
4fd71279cf
@ -55,7 +55,7 @@ export class MediaRepository {
|
||||
|
||||
async downloadEncryptedFile(fileEntry) {
|
||||
const url = this.mxcUrl(fileEntry.url);
|
||||
const {body: encryptedBuffer} = await this._request(url, {format: "buffer"}).response();
|
||||
const {body: encryptedBuffer} = await this._request(url, {format: "buffer", cache: true}).response();
|
||||
const decryptedBuffer = await decryptAttachment(this._cryptoDriver, encryptedBuffer, fileEntry);
|
||||
return decryptedBuffer;
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ class RequestResult {
|
||||
}
|
||||
|
||||
export function createFetchRequest(createTimeout) {
|
||||
return function fetchRequest(url, {method, headers, body, timeout, format}) {
|
||||
return function fetchRequest(url, {method, headers, body, timeout, format, cache = false}) {
|
||||
const controller = typeof AbortController === "function" ? new AbortController() : null;
|
||||
let options = {method, body};
|
||||
if (controller) {
|
||||
@ -59,7 +59,9 @@ export function createFetchRequest(createTimeout) {
|
||||
signal: controller.signal
|
||||
});
|
||||
}
|
||||
if (!cache) {
|
||||
url = addCacheBuster(url);
|
||||
}
|
||||
options = Object.assign(options, {
|
||||
mode: "cors",
|
||||
credentials: "omit",
|
||||
|
Loading…
Reference in New Issue
Block a user