MOBILE-3164 files: Use tokenpluginfile only with slash params

main
Dani Palou 2019-11-08 13:54:12 +01:00
parent 961c873d80
commit bc0d22450e
1 changed files with 4 additions and 1 deletions

View File

@ -150,8 +150,11 @@ export class CoreUrlUtilsProvider {
return url; return url;
} }
if (accessKey) { const hasSlashParams = !url.match(/[\&?]file=/);
if (accessKey && hasSlashParams) {
// We have the user access key, use tokenpluginfile.php. // We have the user access key, use tokenpluginfile.php.
// Do not use it without slash params, the URL doesn't work.
url = url.replace(/(\/webservice)?\/pluginfile\.php/, '/tokenpluginfile.php/' + accessKey); url = url.replace(/(\/webservice)?\/pluginfile\.php/, '/tokenpluginfile.php/' + accessKey);
return url; return url;