Cleaned up code to follow project code style
This commit is contained in:
parent
fbe3b95e8c
commit
706c57308e
|
@ -34,11 +34,11 @@ typedef enum
|
|||
* NSMutableURLRequest.HTTPShouldHandleCookies = YES;
|
||||
*/
|
||||
SDWebImageDownloaderHandleCookies = 1 << 5,
|
||||
SDWebImageDownloaderAllowInvalidSSLCertificates = 1 << 6
|
||||
/**
|
||||
* Enable this to allow untrusted SSL ceriticates.
|
||||
* Useful for testing purposes.
|
||||
* Enable to allow untrusted SSL ceriticates.
|
||||
* Useful for testing purposes. Use with caution in production.
|
||||
*/
|
||||
SDWebImageDownloaderAllowInvalidSSLCertificates = 1 << 6
|
||||
|
||||
} SDWebImageDownloaderOptions;
|
||||
|
||||
|
|
|
@ -371,13 +371,16 @@
|
|||
return self.options & SDWebImageDownloaderContinueInBackground;
|
||||
}
|
||||
|
||||
- (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace {
|
||||
- (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace
|
||||
{
|
||||
return [protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust];
|
||||
}
|
||||
|
||||
- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge {
|
||||
- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
|
||||
{
|
||||
BOOL trustAllCertificates = (self.options & SDWebImageDownloaderAllowInvalidSSLCertificates);
|
||||
if (trustAllCertificates && [challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
|
||||
if (trustAllCertificates && [challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust])
|
||||
{
|
||||
[challenge.sender useCredential:[NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]
|
||||
forAuthenticationChallenge:challenge];
|
||||
}
|
||||
|
|
|
@ -52,11 +52,11 @@ typedef enum
|
|||
* NSMutableURLRequest.HTTPShouldHandleCookies = YES;
|
||||
*/
|
||||
SDWebImageHandleCookies = 1 << 6,
|
||||
SDWebImageAllowInvalidSSLCertificates = 1 << 7
|
||||
/**
|
||||
* Enable this to allow untrusted SSL ceriticates.
|
||||
* Useful for testing purposes.
|
||||
* Enable to allow untrusted SSL ceriticates.
|
||||
* Useful for testing purposes. Use with caution in production.
|
||||
*/
|
||||
SDWebImageAllowInvalidSSLCertificates = 1 << 7
|
||||
} SDWebImageOptions;
|
||||
|
||||
typedef void(^SDWebImageCompletedBlock)(UIImage *image, NSError *error, SDImageCacheType cacheType);
|
||||
|
|
Loading…
Reference in New Issue