Skip to content

Commit

Permalink
Hotfix search params in original file path
Browse files Browse the repository at this point in the history
  • Loading branch information
davidvanleeuwen committed Jan 6, 2025
1 parent 50e99ed commit 9ad2d9d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/embed/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ export class EmbedController {
const url = new URL(
`${this.cdnRoot}/${this.embedId}${file == 'manifest' ? '/' : this.version}${file}`,
);

if (file.includes('?')) {
const [_file, query] = file.split('?');
const query_params = new URLSearchParams(query);
query_params.forEach((value, key) => {
params.append(key, value);
});
}

if (this.token) params.append('token', this.token);
if (!this.caching) params.append('e', new Date().getTime().toString());
url.search = params.toString();
Expand Down

0 comments on commit 9ad2d9d

Please sign in to comment.