forked from EVOgeek/Vmeda.Online
		
	Merge pull request #3441 from alfonso-salces/MOBILE-4184
MOBILE-4184 url.ts: Read new property from config
This commit is contained in:
		
						commit
						6a5d270601
					
				@ -109,5 +109,6 @@
 | 
			
		||||
        "short": 2000,
 | 
			
		||||
        "long": 3500,
 | 
			
		||||
        "sticky": 0
 | 
			
		||||
    }
 | 
			
		||||
    },
 | 
			
		||||
    "disableTokenFile": false
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -118,7 +118,7 @@ export class CoreUrlUtilsProvider {
 | 
			
		||||
    canUseTokenPluginFile(url: string, siteUrl: string, accessKey?: string): boolean {
 | 
			
		||||
        // Do not use tokenpluginfile if site doesn't use slash params, the URL doesn't work.
 | 
			
		||||
        // Also, only use it for "core" pluginfile endpoints. Some plugins can implement their own endpoint (like customcert).
 | 
			
		||||
        return !!accessKey && !url.match(/[&?]file=/) && (
 | 
			
		||||
        return !CoreConstants.CONFIG.disableTokenFile && !!accessKey && !url.match(/[&?]file=/) && (
 | 
			
		||||
            url.indexOf(CoreText.concatenatePaths(siteUrl, 'pluginfile.php')) === 0 ||
 | 
			
		||||
            url.indexOf(CoreText.concatenatePaths(siteUrl, 'webservice/pluginfile.php')) === 0);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										1
									
								
								src/types/config.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								src/types/config.d.ts
									
									
									
									
										vendored
									
									
								
							@ -73,4 +73,5 @@ export interface EnvironmentConfig {
 | 
			
		||||
    toastDurations: Record<ToastDuration, number>;
 | 
			
		||||
    disableCallWSInBackground?: boolean; // If true, disable calling WS in background.
 | 
			
		||||
    callWSInBackgroundExpirationTime?: number; // Ms to consider an entry expired when calling WS in background. Default: 1 week.
 | 
			
		||||
    disableTokenFile: boolean; // Disable the use of tokenpluginfile.php for downloading files (so it fallbacks to pluginfile.php)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user