Use /app_webview/ rather than app_webview to filter bad requests

This commit is contained in:
Ian Clelland 2014-10-30 12:17:05 -04:00
parent ac1f9c790a
commit c8f44ab460

View File

@ -49,12 +49,12 @@ public class CordovaUriHelper {
Boolean pluginManagerAllowsNavigation = this.appView.getPluginManager().shouldAllowNavigation(url);
if (pluginManagerAllowsNavigation == null) {
// Default policy:
// Internal urls on file:// or data:// that do not contain "app_webview" are allowed for navigation
// Internal urls on file:// or data:// that do not contain "/app_webview/" are allowed for navigation
if(url.startsWith("file://") || url.startsWith("data:"))
{
//This directory on WebKit/Blink based webviews contains SQLite databases!
//DON'T CHANGE THIS UNLESS YOU KNOW WHAT YOU'RE DOING!
return !url.contains("app_webview");
return !url.contains("/app_webview/");
}
return false;
}
@ -88,12 +88,12 @@ public class CordovaUriHelper {
Boolean pluginManagerAllowsRequest = this.appView.getPluginManager().shouldAllowRequest(url);
if (pluginManagerAllowsRequest == null) {
// Default policy:
// Internal urls on file:// or data:// that do not contain "app_webview" are allowed for navigation
// Internal urls on file:// or data:// that do not contain "/app_webview/" are allowed for navigation
if(url.startsWith("file://") || url.startsWith("data:"))
{
//This directory on WebKit/Blink based webviews contains SQLite databases!
//DON'T CHANGE THIS UNLESS YOU KNOW WHAT YOU'RE DOING!
return !url.contains("app_webview");
return !url.contains("/app_webview/");
}
return false;
}