cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject ios commit: CB-6580 - CDVWhitelistTests are failing
Date Tue, 06 May 2014 05:34:20 GMT
Repository: cordova-ios
Updated Branches:
  refs/heads/master 87c751c54 -> ab4f4bed2


CB-6580 - CDVWhitelistTests are failing


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

Branch: refs/heads/master
Commit: ab4f4bed2280b7b75b3d4c1ade761e0025b1604e
Parents: 87c751c
Author: Shazron Abdullah <shazron@apache.org>
Authored: Mon May 5 22:34:11 2014 -0700
Committer: Shazron Abdullah <shazron@apache.org>
Committed: Mon May 5 22:34:11 2014 -0700

----------------------------------------------------------------------
 CordovaLibTests/CDVWhitelistTests.m | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/ab4f4bed/CordovaLibTests/CDVWhitelistTests.m
----------------------------------------------------------------------
diff --git a/CordovaLibTests/CDVWhitelistTests.m b/CordovaLibTests/CDVWhitelistTests.m
index 00655e7..77b3b75 100644
--- a/CordovaLibTests/CDVWhitelistTests.m
+++ b/CordovaLibTests/CDVWhitelistTests.m
@@ -148,14 +148,17 @@
         @"192.168.1.*",
         @"192.168.2.*",
         nil];
-
+    
     CDVWhitelist* whitelist = [[CDVWhitelist alloc] initWithArray:allowedHosts];
 
     STAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://apache.org"]], nil);
-    STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://192.168.1.1"]], nil);
-    STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://192.168.1.2"]], nil);
-    STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://192.168.2.1"]], nil);
-    STAssertTrue([whitelist URLIsAllowed:[NSURL URLWithString:@"http://192.168.2.2"]], nil);
+    
+    // Ever since Cordova 3.1, whitelist wildcards are simplified, only "*" and "*.apache.org"
(subdomain example) are allowed. Therefore the next four tests should fail
+    STAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://192.168.1.1"]], nil);
+    STAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://192.168.1.2"]], nil);
+    STAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://192.168.2.1"]], nil);
+    STAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://192.168.2.2"]], nil);
+    
     STAssertFalse([whitelist URLIsAllowed:[NSURL URLWithString:@"http://192.168.3.1"]], nil);
 }
 


Mime
View raw message