#7280 closed feature request (fixed)
Add CORS headers to the image download URL responses
Reported by: | olgabulat | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | Photo Directory | Keywords: | |
Cc: |
Description
In order to improve Photo Directory integration in Gutenberg through Openverse, the direct image URLs needs to set
Access-Control-Allow-Origin="*"
headers.
Gutenberg Openverse media inserter tries to download the images from providers (such as Photo Directory) and add it to the Media Library. When the direct image URL does not have a CORS header, the following error is thrown:
This image cannot be uploaded to your Media Library, but it can still be inserted as an external image.
This is the code in Gutenberg that shows this modal when an image cannot be fetched due to CORS issue:
Can we add the CORS headers to the image URLs?
Attachments (1)
Change History (4)
This ticket was mentioned in Slack in #meta by courtneyengle. View the logs.
15 months ago
#2
@
15 months ago
- Resolution set to fixed
- Status changed from new to closed
@olgabulat: Thanks for the report! I've added the Access-Control-Allow-Origin="*"
header to the direct image URLs.
I've verified the header and tested it on a WP 6.3 install by searching Openverse via the Media Inserter to find an image that originated in the Photo Directory. It worked. (I, however, neglected to confirm that it didn't work before the change.) Let me know if the change is insufficient and what else may be needed.
Error when adding an image from Photo Directory using Gutenberg Openverse integration