]> git.saurik.com Git - cydia.git/commitdiff
Send /either/ X-Cydia-Token or X-Cydia-Id.
authorJay Freeman (saurik) <saurik@saurik.com>
Mon, 14 Mar 2011 12:11:13 +0000 (05:11 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Mon, 14 Mar 2011 12:11:13 +0000 (05:11 -0700)
MobileCydia.mm

index 9732aae7f9537d7d89f87c7ccb2c41133536179b..8ec1244ee3612c7faabb3d9c416fdfc9b5a98249 100644 (file)
@@ -4557,16 +4557,22 @@ static _H<NSMutableSet> 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;