Merge pull request #1178 from marciomeschini/marco/fix_accept_header
add webp accepted content type only if WebP enabled
Showing
1 changed file
with
5 additions
and
1 deletions
@@ -67,7 +67,11 @@ static NSString *const kCompletedCallbackKey = @"completed"; | @@ -67,7 +67,11 @@ static NSString *const kCompletedCallbackKey = @"completed"; | ||
67 | _downloadQueue = [NSOperationQueue new]; | 67 | _downloadQueue = [NSOperationQueue new]; |
68 | _downloadQueue.maxConcurrentOperationCount = 6; | 68 | _downloadQueue.maxConcurrentOperationCount = 6; |
69 | _URLCallbacks = [NSMutableDictionary new]; | 69 | _URLCallbacks = [NSMutableDictionary new]; |
70 | - _HTTPHeaders = [NSMutableDictionary dictionaryWithObject:@"image/webp,image/*;q=0.8" forKey:@"Accept"]; | 70 | +#ifdef SD_WEBP |
71 | + _HTTPHeaders = [@{@"Accept": @"image/webp,image/*;q=0.8"} mutableCopy]; | ||
72 | +#else | ||
73 | + _HTTPHeaders = [@{@"Accept": @"image/*;q=0.8"} mutableCopy]; | ||
74 | +#endif | ||
71 | _barrierQueue = dispatch_queue_create("com.hackemist.SDWebImageDownloaderBarrierQueue", DISPATCH_QUEUE_CONCURRENT); | 75 | _barrierQueue = dispatch_queue_create("com.hackemist.SDWebImageDownloaderBarrierQueue", DISPATCH_QUEUE_CONCURRENT); |
72 | _downloadTimeout = 15.0; | 76 | _downloadTimeout = 15.0; |
73 | } | 77 | } |
-
Please register or login to post a comment