Skip to content
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

Add CORS config to the handler #68

Open
jwoertink opened this issue Apr 21, 2023 · 1 comment
Open

Add CORS config to the handler #68

jwoertink opened this issue Apr 21, 2023 · 1 comment
Labels
enhancement New feature or request hacktoberfest Valid Issue for Hacktoberfest

Comments

@jwoertink
Copy link
Collaborator

https://guides.rubyonrails.org/action_cable_overview.html#allowed-request-origins

The Rails version allows a few CORS settings to be checked, and it rejects connections when they don't match:

config.action_cable.allowed_request_origins = ['https://rubyonrails.com', %r{http://ruby.*}]
# disable it with
config.action_cable.disable_request_forgery_protection = true
@jwoertink jwoertink added the enhancement New feature or request label Apr 21, 2023
@jwoertink
Copy link
Collaborator Author

What I'd love here is if there's a way we can do it on a per channel basis.... No clue how that would work, but if I could say ChatChannel must be protected by CORS on the same domain, but ApiChannel has different restrictions as it may be accessed outside of the domain.

@jwoertink jwoertink added the hacktoberfest Valid Issue for Hacktoberfest label Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest Valid Issue for Hacktoberfest
Projects
None yet
Development

No branches or pull requests

1 participant