Showing
3 changed files
with
16 additions
and
8 deletions
| @@ -135,7 +135,7 @@ | @@ -135,7 +135,7 @@ | ||
| 135 | if (ttl > 0) { | 135 | if (ttl > 0) { |
| 136 | [request addRequestHeader:@"X-Ttl" value:[NSString stringWithFormat:@"%i", ttl]]; | 136 | [request addRequestHeader:@"X-Ttl" value:[NSString stringWithFormat:@"%i", ttl]]; |
| 137 | } | 137 | } |
| 138 | - [request addRequestHeader:@"X-Ttl" value:cdnEnabled ? @"True" : @"False"]; | 138 | + [request addRequestHeader:@"X-Cdn-Enabled" value:cdnEnabled ? @"True" : @"False"]; |
| 139 | return request; | 139 | return request; |
| 140 | } | 140 | } |
| 141 | 141 |
| @@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
| 21 | #import "ASIInputStream.h" | 21 | #import "ASIInputStream.h" |
| 22 | 22 | ||
| 23 | // Automatically set on build | 23 | // Automatically set on build |
| 24 | -NSString *ASIHTTPRequestVersion = @"v1.2-30 2010-01-10"; | 24 | +NSString *ASIHTTPRequestVersion = @"v1.2-31 2010-01-10"; |
| 25 | 25 | ||
| 26 | // We use our own custom run loop mode as CoreAnimation seems to want to hijack our threads otherwise | 26 | // We use our own custom run loop mode as CoreAnimation seems to want to hijack our threads otherwise |
| 27 | static CFStringRef ASIHTTPRequestRunMode = CFSTR("ASIHTTPRequest"); | 27 | static CFStringRef ASIHTTPRequestRunMode = CFSTR("ASIHTTPRequest"); |
| @@ -292,15 +292,23 @@ static NSString *apiKey = @"1c331a7a4a6eb58ca6072afe81e812d0"; | @@ -292,15 +292,23 @@ static NSString *apiKey = @"1c331a7a4a6eb58ca6072afe81e812d0"; | ||
| 292 | GHAssertTrue([[request containers] count] == 2, @"Failed to retrieve limited CDN container list"); | 292 | GHAssertTrue([[request containers] count] == 2, @"Failed to retrieve limited CDN container list"); |
| 293 | } | 293 | } |
| 294 | 294 | ||
| 295 | -//////// | 295 | +- (void)testCDNPut { |
| 296 | -/* | ||
| 297 | -- (void)testSkeleton { | ||
| 298 | [self authenticate]; | 296 | [self authenticate]; |
| 299 | - GHAssertTrue(NO, @"Test not implemented."); | 297 | + |
| 298 | + ASICloudFilesCDNRequest *request = [ASICloudFilesCDNRequest putRequestWithContainer:@"overhrd.com"]; | ||
| 299 | + [request start]; | ||
| 300 | + | ||
| 301 | + GHAssertNotNil([request cdnURI], @"Failed to PUT to CDN container"); | ||
| 300 | } | 302 | } |
| 301 | -*/ | ||
| 302 | - | ||
| 303 | 303 | ||
| 304 | +- (void)testCDNPost { | ||
| 305 | + [self authenticate]; | ||
| 306 | + | ||
| 307 | + ASICloudFilesCDNRequest *request = [ASICloudFilesCDNRequest postRequestWithContainer:@"overhrd.com" cdnEnabled:YES ttl:86600]; | ||
| 308 | + [request start]; | ||
| 309 | + | ||
| 310 | + GHAssertNotNil([request cdnURI], @"Failed to POST to CDN container"); | ||
| 311 | +} | ||
| 304 | 312 | ||
| 305 | -(void)dealloc { | 313 | -(void)dealloc { |
| 306 | [networkQueue release]; | 314 | [networkQueue release]; |
-
Please register or login to post a comment