Authored by Konstantinos K

Merge pull request #1178 from marciomeschini/marco/fix_accept_header

add webp accepted content type only if WebP enabled
@@ -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 }