add no-cache for dropbox

This commit is contained in:
fyears 2022-04-30 23:11:16 +08:00
parent f6f7d83a35
commit d3d26bfe49

View File

@ -371,9 +371,13 @@ export class WrappedDropboxClient {
throw Error("The user has not manually auth yet."); throw Error("The user has not manually auth yet.");
} }
const currentTs = Date.now(); const currentTs = Date.now();
const customHeaders = {
"Cache-Control": "no-cache",
};
if (this.dropboxConfig.accessTokenExpiresAtTime > currentTs) { if (this.dropboxConfig.accessTokenExpiresAtTime > currentTs) {
this.dropbox = new Dropbox({ this.dropbox = new Dropbox({
accessToken: this.dropboxConfig.accessToken, accessToken: this.dropboxConfig.accessToken,
customHeaders: customHeaders,
}); });
} else { } else {
if (this.dropboxConfig.refreshToken === "") { if (this.dropboxConfig.refreshToken === "") {
@ -393,6 +397,7 @@ export class WrappedDropboxClient {
); );
this.dropbox = new Dropbox({ this.dropbox = new Dropbox({
accessToken: this.dropboxConfig.accessToken, accessToken: this.dropboxConfig.accessToken,
customHeaders: customHeaders,
}); });
} }