From a52baa58747d8ce8cd1daa5f427f8e398b354f79 Mon Sep 17 00:00:00 2001 From: Samed Ozdemir Date: Wed, 19 Nov 2025 05:06:43 -0500 Subject: [PATCH] [compliments] fix: duplicate query param "?" in compliments module refresh url (#3967) Checks if `this.config.remoteFile.includes` already contains a `?` - If it does, uses `&` to append the dummy parameter - If it doesn't, uses `?` to start a new query string --- CHANGELOG.md | 1 + modules/default/compliments/compliments.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b780918..3b9a4aad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ planned for 2026-01-01 - fixed problems with daylight-saving-time in weather provider `openmeto` (#3930, #3931) - [newsfeed] fixed header layout issue introduced with prettier njk linting (#3946) - [weather] fixed windy icon not showing up in pirateweather (#3957) +- [compliments] fixed duplicate query param "?" when constructing refresh url (#3967) ### Updated diff --git a/modules/default/compliments/compliments.js b/modules/default/compliments/compliments.js index 481a0854..5e289109 100644 --- a/modules/default/compliments/compliments.js +++ b/modules/default/compliments/compliments.js @@ -214,8 +214,9 @@ Module.register("compliments", { // we need to force the server to not give us the cached result // create an extra property (ignored by the server handler) just so the url string is different // that will never be the same, using the ms value of date - if (isRemote && this.config.remoteFileRefreshInterval !== 0) this.urlSuffix = `?dummy=${Date.now()}`; - // + if (isRemote && this.config.remoteFileRefreshInterval !== 0) { + this.urlSuffix = this.config.remoteFile.includes("?") ? `&dummy=${Date.now()}` : `?dummy=${Date.now()}`; + } try { const response = await fetch(url + this.urlSuffix); return await response.text();