question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Serve `public/uploads` files with CORS

See original GitHub issue

Context

This was discovered by @ivanmalagon when testing locally stored organisation assets.

Steps to Reproduce

  1. 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:closed
  • Created 7 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
javitoninocommented, Jan 13, 2017

😅 You had me scared for a second there 😉

0reactions
javierarcecommented, Jan 16, 2017

👍 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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found