Replaced #1345 - Added urlCredential property to SDWebImageDownloader
This commit is contained in:
parent
3b9c09142a
commit
dcb7985c5c
|
@ -109,6 +109,11 @@ typedef NSDictionary *(^SDWebImageDownloaderHeadersFilterBlock)(NSURL *url, NSDi
|
|||
*/
|
||||
+ (SDWebImageDownloader *)sharedDownloader;
|
||||
|
||||
/**
|
||||
* Set the default URL credential to be set for request operations.
|
||||
*/
|
||||
@property (strong, nonatomic) NSURLCredential *urlCredential;
|
||||
|
||||
/**
|
||||
* Set username
|
||||
*/
|
||||
|
|
|
@ -172,7 +172,9 @@ static NSString *const kCompletedCallbackKey = @"completed";
|
|||
}];
|
||||
operation.shouldDecompressImages = wself.shouldDecompressImages;
|
||||
|
||||
if (wself.username && wself.password) {
|
||||
if (wself.urlCredential) {
|
||||
operation.credential = wself.urlCredential;
|
||||
} else if (wself.username && wself.password) {
|
||||
operation.credential = [NSURLCredential credentialWithUser:wself.username password:wself.password persistence:NSURLCredentialPersistenceForSession];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue