Skip to content

Commit

Permalink
fix(urls): fix support for URLs with query parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
wcandillon committed Mar 31, 2017
1 parent 12fd058 commit 22f712d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ type CacheEntry = {
export class ImageCache {

private getPath(uri: string, immutable?: boolean): string {
const ext = uri.substring(uri.lastIndexOf("."));
const ext =
uri.indexOf("?") === -1 ?
uri.substring(uri.lastIndexOf("."))
:
uri.substring(uri.lastIndexOf("."), uri.indexOf("?"));
if (immutable === true) {
return dirs.CacheDir + "/" + SHA1(uri) + ext;
} else {
Expand Down

0 comments on commit 22f712d

Please sign in to comment.