From 903b106e46d15375c493833c71cbe7408efe0363 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Mon, 7 Feb 2011 16:21:37 -0800 Subject: Support non-NSHTTPURLResponse https?:// NSURLResponse. --- MobileCydia.mm | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'MobileCydia.mm') 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"] || -- cgit v1.2.3