Skip cache-buster query for Dropbox stream URLs
This commit is contained in:
@@ -109,6 +109,15 @@ function connectRadioChannelSource(
|
||||
}
|
||||
|
||||
function freshStreamUrl(streamUrl: string): string {
|
||||
try {
|
||||
const parsed = new URL(streamUrl);
|
||||
const hostname = parsed.hostname.toLowerCase();
|
||||
if (hostname.endsWith('dropbox.com') || hostname.endsWith('dropboxusercontent.com')) {
|
||||
return streamUrl;
|
||||
}
|
||||
} catch {
|
||||
// Leave non-URL strings to the generic cache-buster behavior below.
|
||||
}
|
||||
const separator = streamUrl.includes('?') ? '&' : '?';
|
||||
return `${streamUrl}${separator}chgrid_start=${Date.now()}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user