@micromerce/media-fileuploader 1.0.2108 → 1.0.2110
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +5 -5
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -14971,14 +14971,14 @@ const FileUploader = ({ ...props }) => {
|
|
|
14971
14971
|
if (hasPreview) {
|
|
14972
14972
|
firstUpdate.current = false;
|
|
14973
14973
|
const preViewUrl = file?.url;
|
|
14974
|
+
// Use the URL verbatim: the bewit signs the percent-encoded path, so decoding it turns
|
|
14975
|
+
// e.g. %28/%29 into literal parentheses, the signature no longer matches and the media
|
|
14976
|
+
// service answers 403 "Policy verification failed" (COP-3731).
|
|
14974
14977
|
preViewUrl && previewUrl(preViewUrl)
|
|
14975
|
-
.then((res) =>
|
|
14976
|
-
const t = decodeURIComponent(res);
|
|
14977
|
-
setPreview(t);
|
|
14978
|
-
})
|
|
14978
|
+
.then((res) => setPreview(res))
|
|
14979
14979
|
.catch((e) => {
|
|
14980
14980
|
console.error(e);
|
|
14981
|
-
setPreview(
|
|
14981
|
+
setPreview(preViewUrl);
|
|
14982
14982
|
});
|
|
14983
14983
|
}
|
|
14984
14984
|
}, [file]);
|