@@ -33,7 +33,7 @@ const styles = StyleSheet.create({
33
33
} ) ;
34
34
35
35
function getImageProps ( props ) {
36
- return _ . omit ( props , [ 'source' , 'defaultSource' , 'activityIndicatorProps' , 'style' , 'useQueryParamsInCacheKey' , 'renderImage' ] ) ;
36
+ return _ . omit ( props , [ 'source' , 'defaultSource' , 'activityIndicatorProps' , 'style' , 'useQueryParamsInCacheKey' , 'renderImage' , 'resolveHeaders' ] ) ;
37
37
}
38
38
39
39
const CACHED_IMAGE_REF = 'cachedImage' ;
@@ -45,14 +45,16 @@ const CachedImage = React.createClass({
45
45
useQueryParamsInCacheKey : React . PropTypes . oneOfType ( [
46
46
React . PropTypes . bool ,
47
47
React . PropTypes . array
48
- ] ) . isRequired
48
+ ] ) . isRequired ,
49
+ resolveHeaders : React . PropTypes . func
49
50
} ,
50
51
51
52
getDefaultProps ( ) {
52
53
return {
53
54
renderImage : props => ( < Image ref = { CACHED_IMAGE_REF } { ...props } /> ) ,
54
55
activityIndicatorProps : { } ,
55
- useQueryParamsInCacheKey : false
56
+ useQueryParamsInCacheKey : false ,
57
+ resolveHeaders : ( ) => Promise . resolve ( { } )
56
58
} ;
57
59
} ,
58
60
@@ -118,7 +120,7 @@ const CachedImage = React.createClass({
118
120
// try to get the image path from cache
119
121
ImageCacheProvider . getCachedImagePath ( url , options )
120
122
// try to put the image in cache if
121
- . catch ( ( ) => ImageCacheProvider . cacheImage ( url , options ) )
123
+ . catch ( ( ) => ImageCacheProvider . cacheImage ( url , options , this . props . resolveHeaders ) )
122
124
. then ( cachedImagePath => {
123
125
this . safeSetState ( {
124
126
cachedImagePath
0 commit comments