mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-19 04:17:44 +00:00
don't encode querystring if its the filename (#1395)
* don't encode querystring if its the filename * lint * update link to issue u
This commit is contained in:
@@ -6,9 +6,21 @@ class TaskPlay extends Task {
|
||||
super(logger, opts);
|
||||
this.preconditions = TaskPreconditions.Endpoint;
|
||||
|
||||
this.url = this.data.url.includes('?')
|
||||
? this.data.url.split('?')[0] + '?' + this.data.url.split('?')[1].replaceAll('.', '%2E')
|
||||
: this.data.url;
|
||||
//Cleanup URLs that contain a querystring with a . unless that querystring is the filename
|
||||
// see https://github.com/jambonz/jambonz-feature-server/pull/1293
|
||||
// and https://github.com/jambonz/jambonz-feature-server/issues/1394 for background
|
||||
if (this.data.url.includes('?')) {
|
||||
if (['.mp3', '.wav'].includes(this.data.url.slice(-4))) {
|
||||
this.url = this.data.url;
|
||||
}
|
||||
else {
|
||||
this.url = this.data.url.split('?')[0] + '?' + this.data.url.split('?')[1].replaceAll('.', '%2E');
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.url = this.data.url;
|
||||
}
|
||||
|
||||
this.seekOffset = this.data.seekOffset || -1;
|
||||
this.timeoutSecs = this.data.timeoutSecs || -1;
|
||||
this.loop = this.data.loop || 1;
|
||||
|
||||
Reference in New Issue
Block a user