[wp-meta] [Making WordPress.org] #7280: Add CORS headers to the image download URL responses

Making WordPress.org noreply at wordpress.org
Mon Sep 18 09:32:38 UTC 2023


#7280: Add CORS headers to the image download URL responses
-----------------------------+--------------------
 Reporter:  olgabulat        |      Owner:  (none)
     Type:  feature request  |     Status:  new
 Priority:  normal           |  Milestone:
Component:  Photo Directory  |   Keywords:
-----------------------------+--------------------
 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.''

 [[Image()]]


 This is the code in Gutenberg that shows this modal when an image cannot
 be fetched due to CORS issue:

 https://github.com/WordPress/gutenberg/blob/6db51a6ee92db6c3324a875135656861bbd9e55d/packages
 /block-editor/src/components/inserter/media-tab/media-preview.js#L145-L149

 Can we add the CORS headers to the image URLs?

-- 
Ticket URL: <https://meta.trac.wordpress.org/ticket/7280>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list