Skip to content
This repository was archived by the owner on Apr 15, 2025. It is now read-only.

Commit e9bfa5f

Browse files
committed
Patched protocol validation bug. Added CcheableImage component unit tests. Fixed additional casing issue.
1 parent e98a1fc commit e9bfa5f

File tree

2 files changed

+2
-39
lines changed

2 files changed

+2
-39
lines changed

lib/imageCacheHoc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default function imageCacheHoc(Image, options = {}) {
6565
// Define validator options
6666
let validatorUrlOptions = { protocols: this.options.validProtocols, require_protocol: true };
6767
if (this.options.fileHostWhitelist.length) {
68-
validatorUrlOptions.host_whitelist = this.props.fileHostWhitelist;
68+
validatorUrlOptions.host_whitelist = this.options.fileHostWhitelist;
6969
}
7070

7171
// Validate source prop to be a valid web accessible url.
@@ -91,7 +91,7 @@ export default function imageCacheHoc(Image, options = {}) {
9191
let permanentFileExists = this.fileSystem.exists('permanent/' + fileName);
9292
let cacheFileExists = this.fileSystem.exists('cache/' + fileName);
9393

94-
Promise.all([permanentFileExists, cacheFileExists])
94+
return Promise.all([permanentFileExists, cacheFileExists])
9595
.then( result => {
9696

9797
if (result[0]) {

tests/__snapshots__/imageCacheHoc.test.js.snap

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)