Skip to content

Commit 1ec6cd0

Browse files
committed
Change all placeholder.com sample from http into https
1 parent b6910be commit 1ec6cd0

File tree

4 files changed

+29
-29
lines changed

4 files changed

+29
-29
lines changed

Examples/SDWebImage Demo/MasterViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ - (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibB
7474
@"https://raw.githubusercontent.com/icons8/flat-color-icons/master/pdf/stack_of_photos.pdf",
7575
@"https://nr-platform.s3.amazonaws.com/uploads/platform/published_extension/branding_icon/275/AmazonS3.png",
7676
@"https://res.cloudinary.com/dwpjzbyux/raw/upload/v1666474070/RawDemo/raw_vebed5.NEF",
77-
@"http://via.placeholder.com/200x200.jpg",
77+
@"https://via.placeholder.com/200x200.jpg",
7878
nil];
7979

8080
for (int i=1; i<25; i++) {

Tests/Tests/SDWebImageDownloaderTests.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ - (void)test10That404CaseCallsCompletionWithError {
174174
- (void)test11ThatCancelWorks {
175175
XCTestExpectation *expectation = [self expectationWithDescription:@"Cancel"];
176176

177-
NSURL *imageURL = [NSURL URLWithString:@"http://via.placeholder.com/1000x1000.png"];
177+
NSURL *imageURL = [NSURL URLWithString:@"https://via.placeholder.com/1000x1000.png"];
178178
SDWebImageDownloadToken *token = [[SDWebImageDownloader sharedDownloader]
179179
downloadImageWithURL:imageURL options:0 progress:nil completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished) {
180180
expect(error).notTo.beNil();
@@ -779,7 +779,7 @@ - (void)test30ThatDifferentThumbnailLoadShouldCallbackDifferentSize {
779779
// We move the logic into SDWebImageDownloaderOperation, which decode each callback's thumbnail size with different decoding pipeline, and callback independently
780780
// Note the progressiveLoad does not support this and always callback first size
781781

782-
NSURL *url = [NSURL URLWithString:@"http://via.placeholder.com/501x501.png"];
782+
NSURL *url = [NSURL URLWithString:@"https://via.placeholder.com/501x501.png"];
783783
NSString *fullSizeKey = [SDWebImageManager.sharedManager cacheKeyForURL:url];
784784
[SDImageCache.sharedImageCache removeImageFromDiskForKey:fullSizeKey];
785785
for (int i = 490; i < 500; i++) {

Tests/Tests/SDWebImageManagerTests.m

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ - (void)test06CancellAll {
105105

106106
- (void)test07ThatLoadImageWithSDWebImageRefreshCachedWorks {
107107
XCTestExpectation *expectation = [self expectationWithDescription:@"Image download twice with SDWebImageRefresh failed"];
108-
NSURL *originalImageURL = [NSURL URLWithString:@"http://via.placeholder.com/10x10.png"];
108+
NSURL *originalImageURL = [NSURL URLWithString:@"https://via.placeholder.com/10x10.png"];
109109
__block BOOL firstCompletion = NO;
110110
[[SDWebImageManager sharedManager] loadImageWithURL:originalImageURL options:SDWebImageRefreshCached progress:nil completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
111111
expect(image).toNot.beNil();
@@ -115,7 +115,7 @@ - (void)test07ThatLoadImageWithSDWebImageRefreshCachedWorks {
115115
// Because we call completion before remove the operation from queue, so need a dispatch to avoid get the same operation again. Attention this trap.
116116
// One way to solve this is use another `NSURL instance` because we use `NSURL` as key but not `NSString`. However, this is implementation detail and no guarantee in the future.
117117
dispatch_async(dispatch_get_main_queue(), ^{
118-
NSURL *newImageURL = [NSURL URLWithString:@"http://via.placeholder.com/10x10.png"];
118+
NSURL *newImageURL = [NSURL URLWithString:@"https://via.placeholder.com/10x10.png"];
119119
[[SDWebImageManager sharedManager] loadImageWithURL:newImageURL options:SDWebImageRefreshCached progress:nil completed:^(UIImage * _Nullable image2, NSData * _Nullable data2, NSError * _Nullable error2, SDImageCacheType cacheType2, BOOL finished2, NSURL * _Nullable imageURL2) {
120120
expect(image2).toNot.beNil();
121121
expect(error2).to.beNil();
@@ -132,7 +132,7 @@ - (void)test07ThatLoadImageWithSDWebImageRefreshCachedWorks {
132132

133133
- (void)test08ThatImageTransformerWork {
134134
XCTestExpectation *expectation = [self expectationWithDescription:@"Image transformer work"];
135-
NSURL *url = [NSURL URLWithString:@"http://via.placeholder.com/80x60.png"];
135+
NSURL *url = [NSURL URLWithString:@"https://via.placeholder.com/80x60.png"];
136136
SDWebImageTestTransformer *transformer = [[SDWebImageTestTransformer alloc] init];
137137

138138
transformer.testImage = [[UIImage alloc] initWithContentsOfFile:[self testJPEGPath]];
@@ -293,7 +293,7 @@ - (void)test12ThatStoreCacheTypeWork {
293293

294294
- (void)test13ThatScaleDownLargeImageUseThumbnailDecoding {
295295
XCTestExpectation *expectation = [self expectationWithDescription:@"SDWebImageScaleDownLargeImages should translate to thumbnail decoding"];
296-
NSURL *originalImageURL = [NSURL URLWithString:@"http://via.placeholder.com/3999x3999.png"]; // Max size for this API
296+
NSURL *originalImageURL = [NSURL URLWithString:@"https://via.placeholder.com/2000x2000.png"]; // Max size for this API
297297
NSUInteger defaultLimitBytes = SDImageCoderHelper.defaultScaleDownLimitBytes;
298298
SDImageCoderHelper.defaultScaleDownLimitBytes = 1000 * 1000 * 4; // Limit 1000x1000 pixel
299299
// From v5.5.0, the `SDWebImageScaleDownLargeImages` translate to `SDWebImageContextImageThumbnailPixelSize`, and works for progressive loading
@@ -336,7 +336,7 @@ - (void)test13ThatScaleDownLargeImageEXIFOrientationImage {
336336

337337
- (void)test14ThatCustomCacheAndLoaderWorks {
338338
XCTestExpectation *expectation = [self expectationWithDescription:@"Custom Cache and Loader during manger query"];
339-
NSURL *url = [NSURL URLWithString:@"http://via.placeholder.com/100x100.png"];
339+
NSURL *url = [NSURL URLWithString:@"https://via.placeholder.com/100x100.png"];
340340
SDWebImageContext *context = @{
341341
SDWebImageContextImageCache : SDWebImageTestCache.sharedCache,
342342
SDWebImageContextImageLoader : SDWebImageTestLoader.sharedLoader
@@ -360,7 +360,7 @@ - (void)test14ThatCustomCacheAndLoaderWorks {
360360

361361
- (void)test15ThatQueryCacheTypeWork {
362362
XCTestExpectation *expectation = [self expectationWithDescription:@"Image query cache type works"];
363-
NSURL *url = [NSURL URLWithString:@"http://via.placeholder.com/101x101.png"];
363+
NSURL *url = [NSURL URLWithString:@"https://via.placeholder.com/101x101.png"];
364364
NSString *key = [SDWebImageManager.sharedManager cacheKeyForURL:url];
365365
NSData *testImageData = [NSData dataWithContentsOfFile:[self testJPEGPath]];
366366
[SDImageCache.sharedImageCache storeImageDataToDisk:testImageData forKey:key];
@@ -383,7 +383,7 @@ - (void)test15ThatQueryCacheTypeWork {
383383

384384
- (void)test15ThatOriginalQueryCacheTypeWork {
385385
XCTestExpectation *expectation = [self expectationWithDescription:@"Image original query cache type with transformer works"];
386-
NSURL *url = [NSURL URLWithString:@"http://via.placeholder.com/102x102.png"];
386+
NSURL *url = [NSURL URLWithString:@"https://via.placeholder.com/102x102.png"];
387387
SDWebImageTestTransformer *transformer = [[SDWebImageTestTransformer alloc] init];
388388
transformer.testImage = [[UIImage alloc] initWithContentsOfFile:[self testJPEGPath]];
389389
NSString *originalKey = [SDWebImageManager.sharedManager cacheKeyForURL:url];
@@ -419,7 +419,7 @@ - (void)test15ThatOriginalQueryCacheTypeWork {
419419

420420
- (void)test16ThatTransformerUseDifferentCacheForOriginalAndTransformedImage {
421421
XCTestExpectation *expectation = [self expectationWithDescription:@"Image transformer use different cache instance for original image and transformed image works"];
422-
NSURL *url = [NSURL URLWithString:@"http://via.placeholder.com/103x103.png"];
422+
NSURL *url = [NSURL URLWithString:@"https://via.placeholder.com/103x103.png"];
423423
SDWebImageTestTransformer *transformer = [[SDWebImageTestTransformer alloc] init];
424424
transformer.testImage = [[UIImage alloc] initWithContentsOfFile:[self testJPEGPath]];
425425
NSString *originalKey = [SDWebImageManager.sharedManager cacheKeyForURL:url];
@@ -505,7 +505,7 @@ - (void)test18ThatThumbnailLoadingCanUseFullSizeCache {
505505
CGContextFillRect(context, CGRectMake(0, 0, fullSize.width, fullSize.height));
506506
}];
507507
expect(fullSizeImage.size).equal(fullSize);
508-
NSURL *url = [NSURL URLWithString:@"http://via.placeholder.com/500x500.png"];
508+
NSURL *url = [NSURL URLWithString:@"https://via.placeholder.com/500x500.png"];
509509
NSString *fullSizeKey = [SDWebImageManager.sharedManager cacheKeyForURL:url];
510510
NSData *fullSizeData = fullSizeImage.sd_imageData;
511511
[SDImageCache.sharedImageCache storeImageDataToDisk:fullSizeData forKey:fullSizeKey];
@@ -535,7 +535,7 @@ - (void)test19ThatDifferentThumbnailLoadShouldCallbackDifferentSize {
535535
// We move the logic into SDWebImageDownloaderOperation, which decode each callback's thumbnail size with different decoding pipeline, and callback independently
536536
// Note the progressiveLoad does not support this and always callback first size
537537

538-
NSURL *url = [NSURL URLWithString:@"http://via.placeholder.com/501x501.png"];
538+
NSURL *url = [NSURL URLWithString:@"https://via.placeholder.com/501x501.png"];
539539
NSString *fullSizeKey = [SDWebImageManager.sharedManager cacheKeyForURL:url];
540540
[SDImageCache.sharedImageCache removeImageFromDiskForKey:fullSizeKey];
541541
for (int i = 490; i < 500; i++) {
@@ -563,7 +563,7 @@ - (void)test19ThatDifferentThumbnailLoadShouldCallbackDifferentSize {
563563

564564
- (void)test20ThatContextPassDecodeOptionsWorks {
565565
XCTestExpectation *expectation = [self expectationWithDescription:@"The SDWebImageContextImageDecodeOptions should passed to the coder"];
566-
NSURL *url = [NSURL URLWithString:@"http://via.placeholder.com/502x502.png"];
566+
NSURL *url = [NSURL URLWithString:@"https://via.placeholder.com/502x502.png"];
567567
SDImageCoderOptions *originalDecodeOptions = @{@"Foo": @"Bar", SDImageCoderDecodeScaleFactor : @(2)}; // This will be override
568568

569569
[SDWebImageManager.sharedManager loadImageWithURL:url options:0 context:@{SDWebImageContextImageScaleFactor : @(1), SDWebImageContextImageDecodeOptions : originalDecodeOptions} progress:nil completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
@@ -579,7 +579,7 @@ - (void)test20ThatContextPassDecodeOptionsWorks {
579579
- (void)test21ThatQueryOriginalDiskCacheFromThumbnailShouldNotWriteBackDiskCache {
580580
XCTestExpectation *expectation = [self expectationWithDescription:@"Using original disk cache to do thumbnail decoding or transformer, should not save back disk data again"];
581581

582-
NSURL *url = [NSURL URLWithString:@"http://via.placeholder.com/503x503.png"];
582+
NSURL *url = [NSURL URLWithString:@"https://via.placeholder.com/503x503.png"];
583583
NSString *originalKey = url.absoluteString;
584584
// 1. Store the disk data to original cache
585585
CGSize fullSize = CGSizeMake(503, 503);

Tests/Tests/SDWebImagePrefetcherTests.m

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ - (void)test01ThatSharedPrefetcherIsNotEqualToInitPrefetcher {
3434
- (void)test02PrefetchMultipleImages {
3535
XCTestExpectation *expectation = [self expectationWithDescription:@"Correct prefetch of multiple images"];
3636

37-
NSArray *imageURLs = @[@"http://via.placeholder.com/20x20.jpg",
38-
@"http://via.placeholder.com/30x30.jpg",
39-
@"http://via.placeholder.com/40x40.jpg"];
37+
NSArray *imageURLs = @[@"https://via.placeholder.com/20x20.jpg",
38+
@"https://via.placeholder.com/30x30.jpg",
39+
@"https://via.placeholder.com/40x40.jpg"];
4040

4141
__block NSUInteger numberOfPrefetched = 0;
4242

@@ -72,10 +72,10 @@ - (void)test03PrefetchWithEmptyArrayWillCallTheCompletionWithAllZeros {
7272
- (void)test04PrefetchWithMultipleArrayDifferentQueueWorks {
7373
XCTestExpectation *expectation = [self expectationWithDescription:@"Prefetch with multiple array at different queue failed"];
7474

75-
NSArray *imageURLs1 = @[@"http://via.placeholder.com/20x20.jpg",
76-
@"http://via.placeholder.com/30x30.jpg"];
77-
NSArray *imageURLs2 = @[@"http://via.placeholder.com/30x30.jpg",
78-
@"http://via.placeholder.com/40x40.jpg"];
75+
NSArray *imageURLs1 = @[@"https://via.placeholder.com/20x20.jpg",
76+
@"https://via.placeholder.com/30x30.jpg"];
77+
NSArray *imageURLs2 = @[@"https://via.placeholder.com/30x30.jpg",
78+
@"https://via.placeholder.com/40x40.jpg"];
7979
dispatch_queue_t queue1 = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0);
8080
dispatch_queue_t queue2 = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0);
8181
__block int numberOfPrefetched1 = 0;
@@ -120,7 +120,7 @@ - (void)test05PrefetchLargeURLsAndDelegateWorks {
120120
// This test also test large URLs and thread-safe problem. You can tested with 2000 urls and get the correct result locally. However, due to the limit of CI, 20 is enough.
121121
NSMutableArray<NSURL *> *imageURLs = [NSMutableArray arrayWithCapacity:20];
122122
for (size_t i = 1; i <= 20; i++) {
123-
NSString *url = [NSString stringWithFormat:@"http://via.placeholder.com/%zux%zu.jpg", i, i];
123+
NSString *url = [NSString stringWithFormat:@"https://via.placeholder.com/%zux%zu.jpg", i, i];
124124
[imageURLs addObject:[NSURL URLWithString:url]];
125125
}
126126
self.prefetcher = [SDWebImagePrefetcher new];
@@ -141,9 +141,9 @@ - (void)test05PrefetchLargeURLsAndDelegateWorks {
141141
}
142142

143143
- (void)test06PrefetchCancelToken {
144-
NSArray *imageURLs = @[@"http://via.placeholder.com/20x20.jpg",
145-
@"http://via.placeholder.com/30x30.jpg",
146-
@"http://via.placeholder.com/40x40.jpg"];
144+
NSArray *imageURLs = @[@"https://via.placeholder.com/20x20.jpg",
145+
@"https://via.placeholder.com/30x30.jpg",
146+
@"https://via.placeholder.com/40x40.jpg"];
147147
SDWebImagePrefetcher *prefetcher = [[SDWebImagePrefetcher alloc] init];
148148
SDWebImagePrefetchToken *token = [prefetcher prefetchURLs:imageURLs];
149149
expect(prefetcher.runningTokens.count).equal(1);
@@ -154,9 +154,9 @@ - (void)test06PrefetchCancelToken {
154154
- (void)test07DownloaderCancelDuringPrefetching {
155155
XCTestExpectation *expectation = [self expectationWithDescription:@"Downloader cancel during prefetch should not hung up"];
156156

157-
NSArray *imageURLs = @[@"http://via.placeholder.com/5000x5000.jpg",
158-
@"http://via.placeholder.com/6000x6000.jpg",
159-
@"http://via.placeholder.com/7000x7000.jpg"];
157+
NSArray *imageURLs = @[@"https://via.placeholder.com/5000x5000.jpg",
158+
@"https://via.placeholder.com/6000x6000.jpg",
159+
@"https://via.placeholder.com/7000x7000.jpg"];
160160
for (NSString *url in imageURLs) {
161161
[SDImageCache.sharedImageCache removeImageFromDiskForKey:url];
162162
}

0 commit comments

Comments
 (0)