From: Jay Freeman (saurik) Date: Tue, 8 Feb 2011 00:21:37 +0000 (-0800) Subject: Support non-NSHTTPURLResponse https?:// NSURLResponse. X-Git-Tag: v1.1.0%b1~377^2~1 X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/903b106e46d15375c493833c71cbe7408efe0363 Support non-NSHTTPURLResponse https?:// NSURLResponse. --- diff --git a/MobileCydia.mm b/MobileCydia.mm index 05214834..b809c802 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"] ||