Serve `public/uploads` files with CORS
See original GitHub issueContext
This was discovered by @ivanmalagon when testing locally stored organisation assets.
Steps to Reproduce
- Use a locally stored asset in front
Current Result
settings:1 Access to Image at 'http://localhost.lan:3000/uploads/organization_assets/up…0780-4ccd-83a8-7bf9fee11b34/asset_download_148421623820170112-17158-n63s3l' from origin 'http://globex.localhost.lan:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://globex.localhost.lan:3000' is therefore not allowed access. The response had HTTP status code 404.
Expected result
The asset is displayed.
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
While uploading files: CORS policy: No 'Access-Control-Allow ...
Trying to upload a file to the server (set up on amazon - everything works fine locally) using XMLHttpRequest I get an error:...
Read more >Using cross-origin resource sharing (CORS)
Cross-origin resource sharing (CORS) defines a way for client web applications that are loaded in one domain to interact with resources in a...
Read more >Configuring CORS for Laravel Public Storage - Zaengle Corp
Rachel explains how to configure an Nginx server to add an 'Access-Control-Allow-Origin' header to resources in a Laravel API's public ...
Read more >Cross-Origin Resource Sharing (CORS) - MDN Web Docs
The CORS mechanism supports secure cross-origin requests and data transfers between browsers and servers. Modern browsers use CORS in APIs such ...
Read more >Cross-origin resource sharing (CORS) | Cloud Storage
Most browsers use the XMLHttpRequest object to make a cross-domain request. XMLHttpRequest takes care of all the work of inserting the right headers...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
😅 You had me scared for a second there 😉
👍 Acceptance passed.
I tested uploading an asset with and without using the
RAILS_PUBLIC_UPLOADS_PATH
param and also with and without org subdomain.Thanks for the help with the acceptance phase!