Skip to content

Commit

Permalink
Merge pull request #1856 from ably/1843/fix-fetchrequest-missing-rnd-…
Browse files Browse the repository at this point in the history
…param

[ECO-4913] Fix fetchRequest implementation does not add 'rnd' query parameter so some HTTP requests get cached in browser
  • Loading branch information
VeskeR authored Sep 6, 2024
2 parents 794fa85 + b81d597 commit d8d0abf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/platform/web/lib/http/request/fetchrequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ export default async function fetchRequest(

const resultPromise = (async (): Promise<RequestResult> => {
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!);

Expand Down

0 comments on commit d8d0abf

Please sign in to comment.