From d3d26bfe4960e68912eea6fe6df9ea01c6014583 Mon Sep 17 00:00:00 2001 From: fyears <1142836+fyears@users.noreply.github.com> Date: Sat, 30 Apr 2022 23:11:16 +0800 Subject: [PATCH] add no-cache for dropbox --- src/remoteForDropbox.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/remoteForDropbox.ts b/src/remoteForDropbox.ts index 784153a..ccf16ad 100644 --- a/src/remoteForDropbox.ts +++ b/src/remoteForDropbox.ts @@ -371,9 +371,13 @@ export class WrappedDropboxClient { throw Error("The user has not manually auth yet."); } const currentTs = Date.now(); + const customHeaders = { + "Cache-Control": "no-cache", + }; if (this.dropboxConfig.accessTokenExpiresAtTime > currentTs) { this.dropbox = new Dropbox({ accessToken: this.dropboxConfig.accessToken, + customHeaders: customHeaders, }); } else { if (this.dropboxConfig.refreshToken === "") { @@ -393,6 +397,7 @@ export class WrappedDropboxClient { ); this.dropbox = new Dropbox({ accessToken: this.dropboxConfig.accessToken, + customHeaders: customHeaders, }); }