Revision 3a8071d4 Classes/AccountManager.m

b/Classes/AccountManager.m
542 542
        self.objectDownloadRequests = [NSMutableDictionary dictionary];
543 543
    [objectDownloadRequests setObject:request forKey:object.fullPath];
544 544
    return [self callbackWithRequest:request success:^(OpenStackRequest *request) {
545
        
546 545
        OpenStackAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
547 546
        NSString *filePath = [appDelegate.cacheDirectoryPath stringByAppendingFormat:@"/%@.%@",object.hash, object.name.pathExtension];
548 547
        [[request responseData] writeToFile:filePath atomically:YES];
549 548
        @synchronized(appDelegate.cachedObjectsDictionary) {
549
            if (!object.hash)
550
                object.hash = [request.responseHeaders objectForKey:@"X-Object-Hash"];
550 551
            [appDelegate.cachedObjectsDictionary setObject:filePath forKey:object.hash];
551 552
            [appDelegate saveCacheDictionary];
552 553
        }

Also available in: Unified diff