@micromerce/media-fileuploader 1.0.2105 → 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/cjs/index.js
CHANGED
|
@@ -14973,14 +14973,14 @@ const FileUploader = ({ ...props }) => {
|
|
|
14973
14973
|
if (hasPreview) {
|
|
14974
14974
|
firstUpdate.current = false;
|
|
14975
14975
|
const preViewUrl = file?.url;
|
|
14976
|
+
// Use the URL verbatim: the bewit signs the percent-encoded path, so decoding it turns
|
|
14977
|
+
// e.g. %28/%29 into literal parentheses, the signature no longer matches and the media
|
|
14978
|
+
// service answers 403 "Policy verification failed" (COP-3731).
|
|
14976
14979
|
preViewUrl && previewUrl(preViewUrl)
|
|
14977
|
-
.then((res) =>
|
|
14978
|
-
const t = decodeURIComponent(res);
|
|
14979
|
-
setPreview(t);
|
|
14980
|
-
})
|
|
14980
|
+
.then((res) => setPreview(res))
|
|
14981
14981
|
.catch((e) => {
|
|
14982
14982
|
console.error(e);
|
|
14983
|
-
setPreview(
|
|
14983
|
+
setPreview(preViewUrl);
|
|
14984
14984
|
});
|
|
14985
14985
|
}
|
|
14986
14986
|
}, [file]);
|