Skip to content

Commit

Permalink
fix(pageContent): Add cache buster param to DAV request
Browse files Browse the repository at this point in the history
Enures that we always get the latest DAV content and nobody (neither
browser nor server) cache anything in between.

Fixes: #1437

Signed-off-by: Jonas <jonas@freesources.org>
  • Loading branch information
mejo- committed Aug 28, 2024
1 parent 4448855 commit 1e4716a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/mixins/pageContentMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@ export default {
* @param {string} davUrl URL to fetch page via DAV
*/
async fetchPageContent(davUrl) {
// Add `timestamp` as cache buster param
const axiosConfig = {
params: {
timestamp: Math.floor(Date.now() / 1000),
},
}
// Authenticate via share token for public shares
let axiosConfig = {}
if (this.isPublic) {
axiosConfig = {
auth: {
username: this.shareTokenParam,
},
axiosConfig.auth = {
username: this.shareTokenParam,
}
}

Expand Down

0 comments on commit 1e4716a

Please sign in to comment.