diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2011-02-25 11:15:38 -0800 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2011-03-07 02:41:18 -0800 |
commit | 9d1bf66629d277013ff19a3d717a96aa423c41b5 (patch) | |
tree | a2f14b211a30669a6f4f6fc54fdfb9a1fd49a58b | |
parent | 3171f7feeffaa5f27d852bc6dcb84705f57cf882 (diff) |
Remove CYHomeController's magic HTTP headers.
-rw-r--r-- | MobileCydia.mm | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm index 617562f..3c2c3b2 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -4585,20 +4585,18 @@ static NSString *Warning_; [window setValue:cydia_ forKey:@"cydia"]; } -- (void) _setMoreHeaders:(NSMutableURLRequest *)request { +- (NSURLRequest *) webView:(WebView *)view resource:(id)resource willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source { + NSMutableURLRequest *copy([[super webView:view resource:resource willSendRequest:request redirectResponse:response fromDataSource:source] mutableCopy]); + if (System_ != NULL) - [request setValue:System_ forHTTPHeaderField:@"X-System"]; + [copy setValue:System_ forHTTPHeaderField:@"X-System"]; if (Machine_ != NULL) - [request setValue:[NSString stringWithUTF8String:Machine_] forHTTPHeaderField:@"X-Machine"]; + [copy setValue:[NSString stringWithUTF8String:Machine_] forHTTPHeaderField:@"X-Machine"]; if (Token_ != nil) - [request setValue:Token_ forHTTPHeaderField:@"X-Cydia-Token"]; + [copy setValue:Token_ forHTTPHeaderField:@"X-Cydia-Token"]; if (Role_ != nil) - [request setValue:Role_ forHTTPHeaderField:@"X-Role"]; -} + [copy setValue:Role_ forHTTPHeaderField:@"X-Role"]; -- (NSURLRequest *) webView:(WebView *)view resource:(id)resource willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)response fromDataSource:(WebDataSource *)source { - NSMutableURLRequest *copy([[super webView:view resource:resource willSendRequest:request redirectResponse:response fromDataSource:source] mutableCopy]); - [self _setMoreHeaders:copy]; return copy; } @@ -6488,17 +6486,6 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { return [NSURL URLWithString:@"cydia://home"]; } -- (void) _setMoreHeaders:(NSMutableURLRequest *)request { - [super _setMoreHeaders:request]; - - if (ChipID_ != nil) - [request setValue:ChipID_ forHTTPHeaderField:@"X-Chip-ID"]; - if (UniqueID_ != nil) - [request setValue:UniqueID_ forHTTPHeaderField:@"X-Unique-ID"]; - if (PLMN_ != nil) - [request setValue:PLMN_ forHTTPHeaderField:@"X-Carrier-ID"]; -} - - (void) aboutButtonClicked { UIAlertView *alert([[[UIAlertView alloc] init] autorelease]); |