respect any CDN headers (eg Host for front)

pull/2/head
Michael Kirk 6 years ago
parent 3fb8b02b3b
commit 1fae83a777

@ -1233,10 +1233,19 @@ typedef void (^ProfileManagerFailureBlock)(NSError *error);
}); });
}; };
NSURL *avatarUrlPath = NSURL *avatarUrl = [NSURL URLWithString:userProfile.avatarUrlPath relativeToURL:self.avatarHTTPManager.baseURL];
[NSURL URLWithString:userProfile.avatarUrlPath relativeToURL:self.avatarHTTPManager.baseURL]; NSError *serializationError;
NSURLRequest *request = [NSURLRequest requestWithURL:avatarUrlPath]; NSMutableURLRequest *request =
NSURLSessionDownloadTask *downloadTask = [self.avatarHTTPManager downloadTaskWithRequest:request [self.avatarHTTPManager.requestSerializer requestWithMethod:@"GET"
URLString:avatarUrl.absoluteString
parameters:nil
error:&serializationError];
if (serializationError) {
OWSFailDebug(@"serializationError: %@", serializationError);
return;
}
__block NSURLSessionDownloadTask *downloadTask = [self.avatarHTTPManager downloadTaskWithRequest:request
progress:^(NSProgress *_Nonnull downloadProgress) { progress:^(NSProgress *_Nonnull downloadProgress) {
OWSLogVerbose( OWSLogVerbose(
@"Downloading avatar for %@ %f", userProfile.recipientId, downloadProgress.fractionCompleted); @"Downloading avatar for %@ %f", userProfile.recipientId, downloadProgress.fractionCompleted);

Loading…
Cancel
Save