diff options
-rw-r--r-- | MobileCydia.mm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm index 0a86a2b..3c4acda 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -4632,8 +4632,22 @@ static _H<NSMutableSet> Diversions_; NSMutableURLRequest *copy([request mutableCopy]); NSURL *url([copy URL]); + NSString *href([url absoluteString]); NSString *host([url host]); + if ([href hasPrefix:@"https://cydia.saurik.com/TSS/"]) { + if (NSString *agent = [copy valueForHTTPHeaderField:@"X-User-Agent"]) { + [copy setValue:agent forHTTPHeaderField:@"User-Agent"]; + [copy setValue:nil forHTTPHeaderField:@"X-User-Agent"]; + } + + [copy setValue:nil forHTTPHeaderField:@"Referer"]; + [copy setValue:nil forHTTPHeaderField:@"Origin"]; + + [copy setURL:[NSURL URLWithString:[@"http://gs.apple.com/TSS/" stringByAppendingString:[href substringFromIndex:29]]]]; + return copy; + } + if ([copy valueForHTTPHeaderField:@"X-Cydia-Cf"] == nil) [copy setValue:[NSString stringWithFormat:@"%.2f", kCFCoreFoundationVersionNumber] forHTTPHeaderField:@"X-Cydia-Cf"]; if (Machine_ != NULL && [copy valueForHTTPHeaderField:@"X-Machine"] == nil) |