File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -684,7 +684,7 @@ export class ImageLoader {
684
684
return (
685
685
this . hashString ( url ) . toString ( ) +
686
686
( this . config . fileNameCachedWithExtension
687
- ? this . getExtensionFromFileName ( url )
687
+ ? this . getExtensionFromUrl ( url )
688
688
: '' )
689
689
) ;
690
690
}
@@ -711,15 +711,15 @@ export class ImageLoader {
711
711
}
712
712
713
713
/**
714
- * extract extension from filename or url
714
+ * Extract extension from filename or url
715
715
*
716
- * @param {string } filename
716
+ * @param {string } url
717
717
* @returns {string }
718
718
*/
719
- private getExtensionFromFileName ( filename : string ) : string {
719
+ private getExtensionFromUrl ( url : string ) : string {
720
+ const urlWitoutParams = url . split ( / \# | \? / ) [ 0 ] ;
720
721
return (
721
- // tslint:disable-next-line
722
- filename . substr ( ( ~ - filename . lastIndexOf ( '.' ) >>> 0 ) + 1 ) ||
722
+ urlWitoutParams . substr ( ( ~ - urlWitoutParams . lastIndexOf ( '.' ) >>> 0 ) + 1 ) ||
723
723
this . config . fallbackFileNameCachedExtension
724
724
) ;
725
725
}
You can’t perform that action at this time.
0 commit comments