Merge pull request #2772 from ifsnow/fix/default-accept-header

Change the default value of accept request header
This commit is contained in:
DreamPiggy 2019-06-27 21:08:58 +08:00 committed by GitHub
commit 2441fe5d21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -119,7 +119,7 @@ static void * SDWebImageDownloaderContext = &SDWebImageDownloaderContext;
}
headerDictionary[@"User-Agent"] = userAgent;
}
headerDictionary[@"Accept"] = @"image/*;q=0.8";
headerDictionary[@"Accept"] = @"image/*,*/*;q=0.8";
_HTTPHeaders = headerDictionary;
_HTTPHeadersLock = dispatch_semaphore_create(1);
_operationsLock = dispatch_semaphore_create(1);

View File

@ -37,7 +37,7 @@
}
- (void)test02ThatByDefaultDownloaderSetsTheAcceptHTTPHeader {
expect([[SDWebImageDownloader sharedDownloader] valueForHTTPHeaderField:@"Accept"]).to.match(@"image/\\*");
expect([[SDWebImageDownloader sharedDownloader] valueForHTTPHeaderField:@"Accept"]).to.match(@"image/\\*,\\*/\\*;q=0.8");
}
- (void)test03ThatSetAndGetValueForHTTPHeaderFieldWork {