summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-02-07 16:21:37 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2011-02-07 16:21:37 -0800
commit903b106e46d15375c493833c71cbe7408efe0363 (patch)
tree9c0244e2708d10318c283e22b8506a205dd4a12d
parent6995cc75744a56c2e552404a8de6181fd45ac562 (diff)
Support non-NSHTTPURLResponse https?:// NSURLResponse.
-rw-r--r--MobileCydia.mm16
1 files changed, 7 insertions, 9 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 0521483..b809c80 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -4089,18 +4089,16 @@ static NSString *Warning_;
WebDataSource *source([frame dataSource]);
NSURLResponse *response([source response]);
+
NSURL *url([response URL]);
NSString *scheme([url scheme]);
-
- NSHTTPURLResponse *http;
- if (scheme != nil && ([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"]))
- http = (NSHTTPURLResponse *) response;
- else
- http = nil;
-
- NSDictionary *headers([http allHeaderFields]);
NSString *host([url host]);
- [self setHeaders:headers forHost:host];
+
+ if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
+ NSHTTPURLResponse *http((NSHTTPURLResponse *) response);
+ NSDictionary *headers([http allHeaderFields]);
+ [self setHeaders:headers forHost:host];
+ }
if (
[host isEqualToString:@"cydia.saurik.com"] ||