cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [5/5] git commit: UrlRemap: Use a nicer name for the "ignore-me" request header.
Date Mon, 10 Mar 2014 03:34:29 GMT
UrlRemap: Use a nicer name for the "ignore-me" request header.


Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/6f961db4
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/6f961db4
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/6f961db4

Branch: refs/heads/master
Commit: 6f961db4e2bce0d086d770a79f644bcdfa34346b
Parents: b471b8b
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Sun Mar 9 23:33:17 2014 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Sun Mar 9 23:33:17 2014 -0400

----------------------------------------------------------------------
 UrlRemap/src/ios/UrlRemap.m | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/6f961db4/UrlRemap/src/ios/UrlRemap.m
----------------------------------------------------------------------
diff --git a/UrlRemap/src/ios/UrlRemap.m b/UrlRemap/src/ios/UrlRemap.m
index 546b62d..3885c8c 100644
--- a/UrlRemap/src/ios/UrlRemap.m
+++ b/UrlRemap/src/ios/UrlRemap.m
@@ -242,7 +242,7 @@ static NSString* mimeTypeForPath(NSString* path) {
 @implementation UrlRemapURLProtocol
 
 + (BOOL)canInitWithRequest:(NSURLRequest*)request {
-    if ([request valueForHTTPHeaderField:@"fo"] != nil) {
+    if ([request valueForHTTPHeaderField:@"url-remap-ignore"] != nil) {
         return NO;
     }
     NSURL* url = [request URL];
@@ -266,8 +266,9 @@ static NSString* mimeTypeForPath(NSString* path) {
 - (void)issueRedirectResponseToURL:(NSURL*)dest {
     NSMutableURLRequest* req = [[self request] mutableCopy];
     [req setURL:dest];
-    [req setValue:@"FOO" forHTTPHeaderField:@"fo"];
+    [req setValue:@"1" forHTTPHeaderField:@"url-remap-ignore"];
 
+    // Responses get cached regardless of if we specify Cache-Control here.
     NSURLResponse *response = [[NSHTTPURLResponse alloc] initWithURL:[[self request] URL]
statusCode:302 HTTPVersion:@"HTTP/1.1" headerFields:@{ @"Location": [dest absoluteString]
}];
 
     [[self client] URLProtocol:self wasRedirectedToRequest:req redirectResponse:response];


Mime
View raw message