From b81d597ef1f93513dd94fc284d486ede2ae2efe9 Mon Sep 17 00:00:00 2001 From: Andrew Bulat Date: Fri, 6 Sep 2024 18:35:42 +0100 Subject: [PATCH] Fix fetchRequest implementation does not add 'rnd' query parameter so some HTTP requests get cached in browser Resolves #1843 --- src/platform/web/lib/http/request/fetchrequest.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/platform/web/lib/http/request/fetchrequest.ts b/src/platform/web/lib/http/request/fetchrequest.ts index 27dd29bd6..a73726e9b 100644 --- a/src/platform/web/lib/http/request/fetchrequest.ts +++ b/src/platform/web/lib/http/request/fetchrequest.ts @@ -65,7 +65,10 @@ export default async function fetchRequest( const resultPromise = (async (): Promise => { try { - const res = await Utils.getGlobalObject().fetch(uri + '?' + new URLSearchParams(params || {}), requestInit); + const urlParams = new URLSearchParams(params || {}); + urlParams.set('rnd', Utils.cheapRandStr()); + const preparedURI = uri + '?' + urlParams; + const res = await Utils.getGlobalObject().fetch(preparedURI, requestInit); clearTimeout(timeout!);