From f485cd7d7b69adb87297b974dfe093287f23665a Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 22 Mar 2023 14:59:49 +0100 Subject: [PATCH] Fix URLSearchParams append instead of set Via https://github.com/imagekit-developer/imagekit-javascript/issues/8 --- src/utils/request.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/request.ts b/src/utils/request.ts index dc351f2..729c6c2 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -66,7 +66,7 @@ export const generateSignatureToken = ( var xhr = new XMLHttpRequest(); xhr.timeout = 60000; var urlObj = new URL(authenticationEndpoint); - urlObj.searchParams.set("t", Math.random().toString()); + urlObj.searchParams.append("t", Math.random().toString()); xhr.open('GET', urlObj.toString()); xhr.ontimeout = function (e) { return reject(errorMessages.AUTH_ENDPOINT_TIMEOUT); @@ -128,4 +128,4 @@ export const uploadFile = ( }; uploadFileXHR.send(formData); }); -} \ No newline at end of file +}