summaryrefslogtreecommitdiff
path: root/MobileCydia.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-03-09 04:56:17 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-09 04:56:17 -0800
commit1baae0861a9aaa283e8a95649ba981bd65f35160 (patch)
tree29e79716a21f330eebfe786520a8fa1318681a74 /MobileCydia.mm
parentf3e57badb33f4bc83766379230681df79e823ea3 (diff)
Only add special headers if they are not present.
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r--MobileCydia.mm6
1 files changed, 3 insertions, 3 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 4b69cb4..1f62b2b 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -4265,11 +4265,11 @@ static _H<NSMutableSet> Diversions_;
- (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)
+ if (System_ != NULL && [copy valueForHTTPHeaderField:@"X-System"] == nil)
[copy setValue:System_ forHTTPHeaderField:@"X-System"];
- if (Machine_ != NULL)
+ if (Machine_ != NULL && [copy valueForHTTPHeaderField:@"X-Machine"] == nil)
[copy setValue:[NSString stringWithUTF8String:Machine_] forHTTPHeaderField:@"X-Machine"];
- if (Token_ != nil)
+ if (Token_ != nil && [copy valueForHTTPHeaderField:@"X-Cydia-Token"] == nil)
[copy setValue:Token_ forHTTPHeaderField:@"X-Cydia-Token"];
return copy;