-
-
Notifications
You must be signed in to change notification settings - Fork 889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CORS not working #697
Comments
The two screenshots that you shared are for Socket.IO requests, I don't see any being for a HTML file. Note that both show a URL that begins with How did you initialize the |
Thank you for the reply, I'll do my best to clarify.
The second screenshot is a Socket.IO request from a html file served by flask. The first is being made from a html file served by a node dev server. Notice the difference in the
in
and then in
I run the server with |
This is the documentation for the
If you want to allow all origins, do not include this setting, or set it to |
Removing the However, I did read the documentation sever times, and I still find the description lacking. Setting The reason people would choose to set it despite it being default is because a) defaults can change (although this might break quite a lot of apps) and b) it's explicit (explicit is better than implicit, as the zen goes). |
@alexpana I actually followed your advice and expanded the |
That's awesome, thank you! |
"You can now set it to Still working on this way? I got "Not an accepted origin." for:
The only working is when set to Dev env:
|
@EDario333 when there is any doubt, please consult the documentation. You are reading something that is almost 5 years old. The documentation is always kept up to date. |
please a quick question does cfbm cookie has anything to do with flask cors, cus i keep having this error and unable to find a fix for it yet |
@n1lby73 wrong repo, this is Flask-SocketIO, not Flask-CORS. |
i'm using socket io to implement cors socketio = SocketIO(app, cors_allowed_origins='*') |
@n1lby73 I don't see what is the relation between your question and Flask-SocketIO. You mentioned Flask-CORS. And I have no idea what that cookie you referenced is. |
I'm trying to connect to socketio from the create-react-app dev server, but the flask server isn't returning
Access-Control-Allow-Origin: *
.Here is the request from the create-react-app server (running on port 3000):
And here is the request from a html file served by flask:
Opening the html file locally (with
file:///.../index.html
) doesn't work either.Is this the intended behavior? How can I get flask to play nice with other servers?
The text was updated successfully, but these errors were encountered: