Currently the rendition and thumbnail enrichers return URLs of the form api/v1/id/%s/@rendition/.... When direct download is activated, this causes a redirect to a final blob in S3. However when CORS is used this may cause issues.
The enrichers should return the final redirected URL, if possible.
Details about the code path: RenditionJsonEnricher returns a URL of the form api/v1/id/%s/@rendition/... then when the rendition is requested is goes to RenditionAdapter which calls RenditionObject which calls the rendition service, which returns an arbitrary blob, which gets returned to the JAX-RS framework and goes through BlobWriter, which delegates to DownloadService.downloadBlob which is the one doing a redirect if it finds out that the blob is actually from a Blob Provider that can do direct download redirects.
To improve this, we must make RenditionJsonEnricher directly return the final URL, which means it must compute the rendition immediately on enrichment, which could be very costly if it's not an already-stored rendition. So we must make sure that the rendition service can be queried to know if a rendition blob is immediately available; if not then the previous mechanism still has to be used.