From a4a3ce8a2eb6a4f43f1bc9a7935eb16f2b98a3cd Mon Sep 17 00:00:00 2001 From: mzand33 <59265790+mzand33@users.noreply.github.com> Date: Mon, 12 Jul 2021 07:14:01 -0400 Subject: [PATCH] fix: allow proxy url with parameters (#2100) --- src/core/cache-storage.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/cache-storage.ts b/src/core/cache-storage.ts index aad1fea..45895f6 100644 --- a/src/core/cache-storage.ts +++ b/src/core/cache-storage.ts @@ -180,7 +180,8 @@ export class Cache { }; xhr.onerror = reject; - xhr.open('GET', `${proxy}?url=${encodeURIComponent(src)}&responseType=${responseType}`); + const queryString = proxy.indexOf('?') > -1 ? '&' : '?'; + xhr.open('GET', `${proxy}${queryString}url=${encodeURIComponent(src)}&responseType=${responseType}`); if (responseType !== 'text' && xhr instanceof XMLHttpRequest) { xhr.responseType = responseType;