summaryrefslogtreecommitdiff
path: root/MobileCydia.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-02-25 11:37:57 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-07 02:41:19 -0800
commit8804004f7cb57e6149ec75d6bb9badd0f22ecb6b (patch)
tree2bf4801b93fbe36ff1f71f824e977d246fceb735 /MobileCydia.mm
parentc6bcc0c17bf686a51fc4c6f70baf519ac210856f (diff)
Restrict the cydia JS object to HTTPS.
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r--MobileCydia.mm8
1 files changed, 5 insertions, 3 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index f24459b..1c700e5 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -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 {