You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by br...@apache.org on 2013/04/25 01:25:27 UTC

android commit: [CB-3226] Fix: plugins can intercept urls with "?", "#", "%20"

Updated Branches:
  refs/heads/master a32cf2344 -> 53982272d


[CB-3226] Fix: plugins can intercept urls with "?", "#", "%20"

Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/53982272
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/53982272
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/53982272

Branch: refs/heads/master
Commit: 53982272d694b0bcc2093e8374b3a6fdd64b97fa
Parents: a32cf23
Author: Shravan Narayan <sh...@google.com>
Authored: Wed Apr 24 18:59:24 2013 -0400
Committer: Shravan Narayan <sh...@google.com>
Committed: Wed Apr 24 18:59:24 2013 -0400

----------------------------------------------------------------------
 .../cordova/IceCreamCordovaWebViewClient.java      |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/53982272/framework/src/org/apache/cordova/IceCreamCordovaWebViewClient.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/IceCreamCordovaWebViewClient.java b/framework/src/org/apache/cordova/IceCreamCordovaWebViewClient.java
index 375282e..847972e 100644
--- a/framework/src/org/apache/cordova/IceCreamCordovaWebViewClient.java
+++ b/framework/src/org/apache/cordova/IceCreamCordovaWebViewClient.java
@@ -43,13 +43,12 @@ public class IceCreamCordovaWebViewClient extends CordovaWebViewClient {
 
     @Override
     public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
-        if(url.contains("?") || url.contains("#") || needsIceCreamSpaceInAssetUrlFix(url)){
-            WebResourceResponse ret = generateWebResourceResponse(url);
-            if (ret != null) {
-                return ret;
-            }
+        //Check if plugins intercept the request
+        WebResourceResponse ret = super.shouldInterceptRequest(view, url);
+        if(ret == null && (url.contains("?") || url.contains("#") || needsIceCreamSpaceInAssetUrlFix(url))){
+            ret = generateWebResourceResponse(url);
         }
-        return super.shouldInterceptRequest(view, url);
+        return ret;
     }
 
     private WebResourceResponse generateWebResourceResponse(String url) {