-
Type: Improvement
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 8.10-HF46, 9.10-HF40, 10.10-HF21
-
Fix Version/s: 10.10-HF23, 11.1, 2021.0
-
Component/s: Web API (REST or WS*), Web Common
-
Release Notes Summary:Blob properties can expose a final URL with a parameter.
-
Tags:
-
Impact type:Configuration Change
-
Upgrade notes:
-
Team:FG
-
Sprint:nxFG 11.1.12
Currently, when we marshall a Blob property in JSON, we give the DownloadHelper based URL.
When S3 DirectUpload/Download is configured, the client is then redirected (302) to the S3 URL (can be Cloudfront): https://github.com/nuxeo/nuxeo/blob/master/nuxeo-core/nuxeo-core-io/src/main/java/org/nuxeo/ecm/core/io/marshallers/json/document/DocumentPropertyJsonWriter.java#L311
However in some cases, when the blob is requested through an AJAX request, it ends up in a CORS error because the Origin header is lost during the redirect (cf https://stackoverflow.com/questions/30193851/ajax-call-following-302-redirect-sets-origin-to-null).
NOTE that this problem only occurs if the webapp and the Nuxeo server run on different domains, as in this situation the webapp makes a first cross-origin request to Nuxeo, which does a redirect to another cross-origin domain (at which point the Origin is set to null — this is per spec and done to avoid CSRF issues in case of a compromised server doing rogue redirects).
When we can, we should directly give the S3 of CloudFront pre-signed URL to download the blob.
- causes
-
WEBUI-371 Fix Direct Edit when platform API returns final URL of blobs
- Open
- is related to
-
NXP-31987 Add a nuxeo.conf property to expose the final Blob URL
- Resolved
-
ELEMENTS-1630 Fix direct download URL failing with appended clientReason parameter
- Resolved
-
WEBUI-1171 Fix direct download URL failing with appended clientReason parameter
- Resolved
-
NXP-28920 Thumbnail JSON enricher should expose final URL if possible
- Open
- Is referenced in