From bfa23eb8a5886926578715359a04a560a9af78af Mon Sep 17 00:00:00 2001 From: fyears <1142836+fyears@users.noreply.github.com> Date: Sat, 30 Apr 2022 23:23:51 +0800 Subject: [PATCH] add no-cache for webdav --- src/remoteForWebdav.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/remoteForWebdav.ts b/src/remoteForWebdav.ts index 803c178..3532874 100644 --- a/src/remoteForWebdav.ts +++ b/src/remoteForWebdav.ts @@ -183,6 +183,9 @@ export class WrappedWebdavClient { init = async () => { // init client if not inited + const headers = { + "Cache-Control": "no-cache", + }; if (this.client === undefined) { if ( this.webdavConfig.username !== "" && @@ -191,6 +194,7 @@ export class WrappedWebdavClient { this.client = createClient(this.webdavConfig.address, { username: this.webdavConfig.username, password: this.webdavConfig.password, + headers: headers, authType: this.webdavConfig.authType === "digest" ? AuthType.Digest @@ -198,7 +202,9 @@ export class WrappedWebdavClient { }); } else { log.info("no password"); - this.client = createClient(this.webdavConfig.address); + this.client = createClient(this.webdavConfig.address, { + headers: headers, + }); } }