-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Description
I've seen this mentioned a few times as responses to merge requests, but not as a dedicated issue, so I'm opening it here.
When I try to use the Prepublish Check -> Upload External Media feature, it fails:
Upload failed, try again.
The console shows:
Access to fetch '(remote url)' from origin (this site) has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
I've seen reports most frequently with Google Docs images, but am experiencing it also with other sites we host.
For reference, some other reports were here:
#64741 (comment)
#46014 (comment)
Step-by-step reproduction instructions
For the sake of reproducing without exposing our site's URLs, I tried an image from google and got the same result.
-
Add an image block, and set the source from URL to be:
https://www.google.com/images/branding/googlelogo/1x/googlelogo_light_color_272x92dp.png -
Publish the Post. See that the External Media check flags this external media for uploading
-
Click 'Upload'
-
See that Upload failed, try again, with the same console error reported above
Screenshots, screen recording, code snippet
No response
Environment info
WP 6.7.2 and 6.8-Beta-3, with and without Gutenberg 20.5.0
Please confirm that you have searched existing issues in the repo.
- Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- Yes
Please confirm which theme type you used for testing.
- Block
- Classic
- Hybrid (e.g. classic with theme.json)
- Not sure