]> git.saurik.com Git - cydia.git/commitdiff
Restrict the cydia JS object to HTTPS.
authorJay Freeman (saurik) <saurik@saurik.com>
Fri, 25 Feb 2011 19:37:57 +0000 (11:37 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Mon, 7 Mar 2011 10:41:19 +0000 (02:41 -0800)
MobileCydia.mm

index f24459b3d3714eec55a0fa62ad03bacf215ece90..1c700e514813ea48470f09fbf0ece70bc6e4197b 100644 (file)
@@ -4572,7 +4572,8 @@ static NSString *Warning_;
     NSURLResponse *response([source response]);
 
     NSURL *url([response URL]);
-    //NSString *scheme([url scheme]);
+
+    NSString *scheme([[url scheme] lowercaseString]);
     NSString *host([url host]);
 
     if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
@@ -4581,8 +4582,9 @@ static NSString *Warning_;
         [self setHeaders:headers forHost:host];
     }
 
-    if ([CydiaHosts_ containsObject:host])
-        [window setValue:cydia_ forKey:@"cydia"];
+    if ([scheme isEqualToString:@"https"])
+        if ([CydiaHosts_ containsObject:host])
+            [window setValue:cydia_ forKey:@"cydia"];
 }
 
 - (NSURLRequest *) webView:(WebView *)view resource:(id)resource willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source {