so unless @artur accept a change for that (and not sure if that make sense), you may need to deal with it in the webserver, check for a solution here: https://stackoverflow.com/a/11077890
Thanks @pauloamgomes and @artur I comment off the Access-Control-Allow-Origin and Access-Control-Allow-Methods lines in index.php and add in .htaccess as below.
I am running into this same issue. I am using cockpit within docker, my issue is I am getting CORS errors on imagery I link to in the cockpit stored assets.
I get the error in Chrome browser: Access to image at 'https://cockpit.example.com/storage/uploads/2022/02/25/image.png' from origin 'https://example.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I noticed in cockpit in index.php:30 (if (COCKPIT_API_REQUEST)) the CORS settings are only applying to API requests.
Is there any way to set multiple origins for file assets?