]> git.saurik.com Git - cydia.git/commitdiff
Support non-NSHTTPURLResponse https?:// NSURLResponse.
authorJay Freeman (saurik) <saurik@saurik.com>
Tue, 8 Feb 2011 00:21:37 +0000 (16:21 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Tue, 8 Feb 2011 00:21:37 +0000 (16:21 -0800)
MobileCydia.mm

index 052148346c58ceff559ca3ab84b169770300a913..b809c8028d5dacc3f31faf6d1e8d395be09dfa73 100644 (file)
@@ -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"] ||