Skip to content

Commit 7692bd2

Browse files
committed
Merge pull request SDWebImage#1178 from marciomeschini/marco/fix_accept_header
add webp accepted content type only if WebP enabled
2 parents 2ee4bfe + e622b29 commit 7692bd2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

SDWebImage/SDWebImageDownloader.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ - (id)init {
6767
_downloadQueue = [NSOperationQueue new];
6868
_downloadQueue.maxConcurrentOperationCount = 6;
6969
_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
7175
_barrierQueue = dispatch_queue_create("com.hackemist.SDWebImageDownloaderBarrierQueue", DISPATCH_QUEUE_CONCURRENT);
7276
_downloadTimeout = 15.0;
7377
}

0 commit comments

Comments
 (0)