Skip to content

Commit

Permalink
Merge pull request SDWebImage#1178 from marciomeschini/marco/fix_acce…
Browse files Browse the repository at this point in the history
…pt_header

add webp accepted content type only if WebP enabled
  • Loading branch information
mythodeia committed Jun 24, 2015
2 parents 2ee4bfe + e622b29 commit 7692bd2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion SDWebImage/SDWebImageDownloader.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ - (id)init {
_downloadQueue = [NSOperationQueue new];
_downloadQueue.maxConcurrentOperationCount = 6;
_URLCallbacks = [NSMutableDictionary new];
_HTTPHeaders = [NSMutableDictionary dictionaryWithObject:@"image/webp,image/*;q=0.8" forKey:@"Accept"];
#ifdef SD_WEBP
_HTTPHeaders = [@{@"Accept": @"image/webp,image/*;q=0.8"} mutableCopy];
#else
_HTTPHeaders = [@{@"Accept": @"image/*;q=0.8"} mutableCopy];
#endif
_barrierQueue = dispatch_queue_create("com.hackemist.SDWebImageDownloaderBarrierQueue", DISPATCH_QUEUE_CONCURRENT);
_downloadTimeout = 15.0;
}
Expand Down

0 comments on commit 7692bd2

Please sign in to comment.