This repository was archived by the owner on Apr 4, 2024. It is now read-only.
Use cors_allowed_origins in AsyncServer#7
Merged
Conversation
Owner
|
Thank you so much for contributing, will make sure to add you to list of contributors ❣️ Merged 🚀🎉 |
Repository owner
locked and limited conversation to collaborators
Nov 25, 2020
This allows controlling cors in the socket server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I needed CORS on my entire app, so I used
app.add_middleware(CORSMiddleware, ...)with a specific origin. This broke websockets because it caused duplicate headers for requests to/ws/*:(For some reason this messed up Firefox's CORS verification) So, I tried to explicitly disabling it with
cors_allowed_origins=[], but I realized the parameter wasn't being used. This PR fixes that. Note that I changed the default parameter to"*"so that the behavior would remain unchanged.