From: Jay Freeman (saurik) Date: Mon, 14 Mar 2011 12:11:13 +0000 (-0700) Subject: Send /either/ X-Cydia-Token or X-Cydia-Id. X-Git-Tag: v1.1.0%b7~3 X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/e7817a6bedf5c3821457925be950e62caa202d4e?ds=inline;hp=3a159223601cb8047afcba6c51be5d9cd8c016b2 Send /either/ X-Cydia-Token or X-Cydia-Id. --- diff --git a/MobileCydia.mm b/MobileCydia.mm index 9732aae7..8ec1244e 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -4557,16 +4557,22 @@ static _H Diversions_; if (Machine_ != NULL && [copy valueForHTTPHeaderField:@"X-Machine"] == nil) [copy setValue:[NSString stringWithUTF8String:Machine_] forHTTPHeaderField:@"X-Machine"]; + bool bridged; bool token; + @synchronized (HostConfig_) { - token = [TokenHosts_ containsObject:host] || [BridgedHosts_ containsObject:host]; + bridged = [BridgedHosts_ containsObject:host]; + token = [TokenHosts_ containsObject:host]; } - if ([url isCydiaSecure] && token) { - if (Token_ != nil && [copy valueForHTTPHeaderField:@"X-Cydia-Token"] == nil) - [copy setValue:Token_ forHTTPHeaderField:@"X-Cydia-Token"]; - if (UniqueID_ != nil && [copy valueForHTTPHeaderField:@"X-Cydia-Id"] == nil) - [copy setValue:UniqueID_ forHTTPHeaderField:@"X-Cydia-Id"]; + if ([url isCydiaSecure]) { + if (bridged) { + if (UniqueID_ != nil && [copy valueForHTTPHeaderField:@"X-Cydia-Id"] == nil) + [copy setValue:UniqueID_ forHTTPHeaderField:@"X-Cydia-Id"]; + } else if (token) { + if (Token_ != nil && [copy valueForHTTPHeaderField:@"X-Cydia-Token"] == nil) + [copy setValue:Token_ forHTTPHeaderField:@"X-Cydia-Token"]; + } } return copy;