Skip to content

Commit dacb804

Browse files
committed
fix: duplicate query param "?" in compliments module refresh url
Checks if this.urlSuffix already contains a ? If it does, uses & to append the dummy parameter If it doesn't, uses ? to start a new query string
1 parent 1796400 commit dacb804

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ planned for 2026-01-01
4747
- fixed problems with daylight-saving-time in weather provider `openmeto` (#3930, #3931)
4848
- [newsfeed] fixed header layout issue introduced with prettier njk linting (#3946)
4949
- [weather] fixed windy icon not showing up in pirateweather (#3957)
50+
- [compliments] fixed duplicate query param "?" when constructing refresh url (#3967)
5051

5152
### Updated
5253

modules/default/compliments/compliments.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,9 @@ Module.register("compliments", {
214214
// we need to force the server to not give us the cached result
215215
// create an extra property (ignored by the server handler) just so the url string is different
216216
// that will never be the same, using the ms value of date
217-
if (isRemote && this.config.remoteFileRefreshInterval !== 0) this.urlSuffix = `?dummy=${Date.now()}`;
218-
//
217+
if (isRemote && this.config.remoteFileRefreshInterval !== 0) {
218+
this.urlSuffix = this.config.remoteFile.includes("?") ? `&dummy=${Date.now()}` : `?dummy=${Date.now()}`;
219+
}
219220
try {
220221
const response = await fetch(url + this.urlSuffix);
221222
return await response.text();

0 commit comments

Comments
 (0)