Skip to content

Commit

Permalink
fix: alway add a timestamp to the url of a cross origin image
Browse files Browse the repository at this point in the history
Fixes #519
  • Loading branch information
fengyuanchen committed Jun 1, 2019
1 parent 6101952 commit f4b22b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## next

- Alway add a timestamp to the url of a cross origin image (#519).

## 1.5.1 (Mar 10, 2019)

- Revert the minimum container width from `300` to `200`.
Expand Down
10 changes: 4 additions & 6 deletions src/js/cropper.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,12 @@ class Cropper {
if (this.options.checkCrossOrigin && isCrossOriginURL(url)) {
({ crossOrigin } = element);

if (crossOrigin) {
crossOriginUrl = url;
} else {
if (!crossOrigin) {
crossOrigin = 'anonymous';

// Bust cache when there is not a "crossOrigin" property
crossOriginUrl = addTimestamp(url);
}

// Bust cache when there is not a "crossOrigin" property (#519)
crossOriginUrl = addTimestamp(url);
}

this.crossOrigin = crossOrigin;
Expand Down

0 comments on commit f4b22b4

Please sign in to comment.