Skip to content

Commit 706c573

Browse files
committed
Cleaned up code to follow project code style
1 parent fbe3b95 commit 706c573

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

SDWebImage/SDWebImageDownloader.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ typedef enum
3434
* NSMutableURLRequest.HTTPShouldHandleCookies = YES;
3535
*/
3636
SDWebImageDownloaderHandleCookies = 1 << 5,
37-
SDWebImageDownloaderAllowInvalidSSLCertificates = 1 << 6
3837
/**
39-
* Enable this to allow untrusted SSL ceriticates.
40-
* Useful for testing purposes.
38+
* Enable to allow untrusted SSL ceriticates.
39+
* Useful for testing purposes. Use with caution in production.
4140
*/
41+
SDWebImageDownloaderAllowInvalidSSLCertificates = 1 << 6
4242

4343
} SDWebImageDownloaderOptions;
4444

SDWebImage/SDWebImageDownloaderOperation.m

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,13 +371,16 @@ - (BOOL)shouldContinueWhenAppEntersBackground
371371
return self.options & SDWebImageDownloaderContinueInBackground;
372372
}
373373

374-
- (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace {
374+
- (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace
375+
{
375376
return [protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust];
376377
}
377378

378-
- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge {
379+
- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
380+
{
379381
BOOL trustAllCertificates = (self.options & SDWebImageDownloaderAllowInvalidSSLCertificates);
380-
if (trustAllCertificates && [challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
382+
if (trustAllCertificates && [challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust])
383+
{
381384
[challenge.sender useCredential:[NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]
382385
forAuthenticationChallenge:challenge];
383386
}

SDWebImage/SDWebImageManager.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ typedef enum
5252
* NSMutableURLRequest.HTTPShouldHandleCookies = YES;
5353
*/
5454
SDWebImageHandleCookies = 1 << 6,
55-
SDWebImageAllowInvalidSSLCertificates = 1 << 7
5655
/**
57-
* Enable this to allow untrusted SSL ceriticates.
58-
* Useful for testing purposes.
56+
* Enable to allow untrusted SSL ceriticates.
57+
* Useful for testing purposes. Use with caution in production.
5958
*/
59+
SDWebImageAllowInvalidSSLCertificates = 1 << 7
6060
} SDWebImageOptions;
6161

6262
typedef void(^SDWebImageCompletedBlock)(UIImage *image, NSError *error, SDImageCacheType cacheType);

0 commit comments

Comments
 (0)