Skip to content

Commit

Permalink
fix: allow proxy url with parameters (#2100)
Browse files Browse the repository at this point in the history
  • Loading branch information
mzand33 authored Jul 12, 2021
1 parent 084017a commit a4a3ce8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/cache-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a4a3ce8

Please sign in to comment.