mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-07 09:31:31 +01:00
no-store cache
This commit is contained in:
parent
3f17b642b4
commit
5819023bc4
@ -115,7 +115,7 @@ export class AttachmentsComponent implements OnInit {
|
||||
}
|
||||
|
||||
a.downloading = true;
|
||||
const response = await fetch(new Request(attachment.url, { cache: 'no-cache' }));
|
||||
const response = await fetch(new Request(attachment.url, { cache: 'no-store' }));
|
||||
if (response.status !== 200) {
|
||||
this.platformUtilsService.showToast('error', null, this.i18nService.t('errorOccurred'));
|
||||
a.downloading = false;
|
||||
@ -170,7 +170,7 @@ export class AttachmentsComponent implements OnInit {
|
||||
this.reuploadPromises[attachment.id] = Promise.resolve().then(async () => {
|
||||
// 1. Download
|
||||
a.downloading = true;
|
||||
const response = await fetch(new Request(attachment.url, { cache: 'no-cache' }));
|
||||
const response = await fetch(new Request(attachment.url, { cache: 'no-store' }));
|
||||
if (response.status !== 200) {
|
||||
this.platformUtilsService.showToast('error', null, this.i18nService.t('errorOccurred'));
|
||||
a.downloading = false;
|
||||
|
@ -192,7 +192,7 @@ export class ViewComponent implements OnDestroy, OnInit {
|
||||
}
|
||||
|
||||
a.downloading = true;
|
||||
const response = await fetch(new Request(attachment.url, { cache: 'no-cache' }));
|
||||
const response = await fetch(new Request(attachment.url, { cache: 'no-store' }));
|
||||
if (response.status !== 200) {
|
||||
this.platformUtilsService.showToast('error', null, this.i18nService.t('errorOccurred'));
|
||||
a.downloading = false;
|
||||
|
@ -169,7 +169,7 @@ export class ApiService implements ApiServiceAbstraction {
|
||||
const response = await this.fetch(new Request(this.identityBaseUrl + '/connect/token', {
|
||||
body: this.qsStringify(request.toIdentityToken(this.platformUtilsService.identityClientId)),
|
||||
credentials: this.getCredentials(),
|
||||
cache: 'no-cache',
|
||||
cache: 'no-store',
|
||||
headers: headers,
|
||||
method: 'POST',
|
||||
}));
|
||||
@ -868,7 +868,7 @@ export class ApiService implements ApiServiceAbstraction {
|
||||
headers.set('User-Agent', this.customUserAgent);
|
||||
}
|
||||
const response = await this.fetch(new Request(this.eventsBaseUrl + '/collect', {
|
||||
cache: 'no-cache',
|
||||
cache: 'no-store',
|
||||
credentials: this.getCredentials(),
|
||||
method: 'POST',
|
||||
body: JSON.stringify(request),
|
||||
@ -918,7 +918,7 @@ export class ApiService implements ApiServiceAbstraction {
|
||||
|
||||
fetch(request: Request): Promise<Response> {
|
||||
if (request.method === 'GET') {
|
||||
request.headers.set('Cache-Control', 'no-cache');
|
||||
request.headers.set('Cache-Control', 'no-store');
|
||||
request.headers.set('Pragma', 'no-cache');
|
||||
}
|
||||
return this.nativeFetch(request);
|
||||
@ -938,7 +938,7 @@ export class ApiService implements ApiServiceAbstraction {
|
||||
}
|
||||
|
||||
const requestInit: RequestInit = {
|
||||
cache: 'no-cache',
|
||||
cache: 'no-store',
|
||||
credentials: this.getCredentials(),
|
||||
method: method,
|
||||
};
|
||||
@ -1011,7 +1011,7 @@ export class ApiService implements ApiServiceAbstraction {
|
||||
client_id: decodedToken.client_id,
|
||||
refresh_token: refreshToken,
|
||||
}),
|
||||
cache: 'no-cache',
|
||||
cache: 'no-store',
|
||||
credentials: this.getCredentials(),
|
||||
headers: headers,
|
||||
method: 'POST',
|
||||
|
@ -795,7 +795,7 @@ export class CipherService implements CipherServiceAbstraction {
|
||||
private async shareAttachmentWithServer(attachmentView: AttachmentView, cipherId: string,
|
||||
organizationId: string): Promise<any> {
|
||||
const attachmentResponse = await this.apiService.nativeFetch(
|
||||
new Request(attachmentView.url, { cache: 'no-cache' }));
|
||||
new Request(attachmentView.url, { cache: 'no-store' }));
|
||||
if (attachmentResponse.status !== 200) {
|
||||
throw Error('Failed to download attachment: ' + attachmentResponse.status.toString());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user