cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From na...@apache.org
Subject [04/10] git commit: CB-5395: Make scheme and host (but not path) case-insensitive in whitelist
Date Tue, 18 Feb 2014 20:14:22 GMT
CB-5395: Make scheme and host (but not path) case-insensitive in whitelist


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

Branch: refs/heads/master
Commit: e06f49ac24fd5b51ad721e38236d3d4fb94444ac
Parents: ea64117
Author: Ian Clelland <iclelland@chromium.org>
Authored: Fri Feb 7 15:01:57 2014 -0500
Committer: Archana Naik <naika@lab126.com>
Committed: Tue Feb 18 12:13:16 2014 -0800

----------------------------------------------------------------------
 framework/src/org/apache/cordova/Whitelist.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/e06f49ac/framework/src/org/apache/cordova/Whitelist.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/Whitelist.java b/framework/src/org/apache/cordova/Whitelist.java
index a868a77..a01d7aa 100644
--- a/framework/src/org/apache/cordova/Whitelist.java
+++ b/framework/src/org/apache/cordova/Whitelist.java
@@ -55,14 +55,14 @@ public class Whitelist {
                 if (scheme == null || "*".equals(scheme)) {
                     this.scheme = null;
                 } else {
-                    this.scheme = Pattern.compile(regexFromPattern(scheme, false));
+                    this.scheme = Pattern.compile(regexFromPattern(scheme, false), Pattern.CASE_INSENSITIVE);
                 }
                 if ("*".equals(host)) {
                     this.host = null;
                 } else if (host.startsWith("*.")) {
-                    this.host = Pattern.compile("([a-z0-9.-]*\\.)?" + regexFromPattern(host.substring(2),
false));
+                    this.host = Pattern.compile("([a-z0-9.-]*\\.)?" + regexFromPattern(host.substring(2),
false), Pattern.CASE_INSENSITIVE);
                 } else {
-                    this.host = Pattern.compile(regexFromPattern(host, false));
+                    this.host = Pattern.compile(regexFromPattern(host, false), Pattern.CASE_INSENSITIVE);
                 }
                 if (port == null || "*".equals(port)) {
                     this.port = null;
@@ -120,7 +120,7 @@ public class Whitelist {
                     whiteList = null;
                 }
                 else { // specific access
-                    Pattern parts = Pattern.compile("^((\\*|[a-z-]+)://)?(\\*|((\\*\\.)?[^*/:]+))?(:(\\d+))?(/.*)?");
+                    Pattern parts = Pattern.compile("^((\\*|[A-Za-z-]+)://)?(\\*|((\\*\\.)?[^*/:]+))?(:(\\d+))?(/.*)?");
                     Matcher m = parts.matcher(origin);
                     if (m.matches()) {
                         String scheme = m.group(2);


Mime
View raw message