Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

CORS #87

Open
MathewT opened this issue Jan 22, 2015 · 4 comments
Open

CORS #87

MathewT opened this issue Jan 22, 2015 · 4 comments

Comments

@MathewT
Copy link

MathewT commented Jan 22, 2015

Hello,
Thanks for creating this project! Is there a way to configure fake-s3 so that it allows requests from all IP addresses? I noticed in server.rb response['Access-Control-Allow-Origin']='*'

My Javascript call to fake-s3 results in Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://172.17.42.1:4567/mb-cosmosproject-dev/0/0/4/0/0040b97f9310741fde6a634fa896d186/artifacts/pe_dump.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=foo%2F20150122%2Flocal-s3%2Fs3%2Faws4_request&X-Amz-Date=20150122T210522Z&X-Amz-Expires=3600&X-Amz-Signature=8e64a5cda541015eac8d92fcb25e1882a1b357f489a272379c21cf8caafc0bd7&X-Amz-SignedHeaders=Host. This can be fixed by moving the resource to the same domain or enabling CORS.

How can I allow fake-s3 to allow all origins?

Thanks,
Mathew

@NickClark
Copy link

You doing a path based post request? I believe CORS is setup for a post request, but the detection is broken in master. I made a fork to get it working for me. I've had a pending pull request to fix this issue for the last year. No response from maintainer :( https://github.com/NickClark/fake-s3

@jubos
Copy link
Owner

jubos commented Feb 18, 2015

Nick, which pull request are you referring to? I see this one: #45, which I can merge into master, but not sure how those diffs would add CORS support.

In any case, CORS was added in v0.1.7, so @MathewT, let me know if fixes your issue.

@NickClark
Copy link

@jubos Correct, the CORS I needed had already been added. I just needed the request to be recognized as such, which is what #45 addressed.

@revett
Copy link

revett commented May 26, 2016

@jubos - can you please merge #45.

Had this exact issue this afternoon. Thanks 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants