Skip to content

Conversation

@toothbrush
Copy link

Per MDN [1], we should always return Access-Control-Allow-Origin, not just on preflight requests. I have a simple frontend app that gets a presigned S3 URL and then attempts to push a file to S3, but i was getting the following error in my browser console:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://my-bucket.fake-s3.my-org.test/. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

Making this change solved the error for me. Many thanks to @shabbyrobe who coached me through it!

  1. https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS#simple_requests

Per MDN [1], we should always return Access-Control-Allow-Origin, not just
on preflight requests.

1. https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CORS#simple_requests

Co-authored-by: Blake Williams <[email protected]>
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant