-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
Websocket CORS Support #5667
Websocket CORS Support #5667
Conversation
What's with gofmt failure in build? Is there something I can/should do to fix that? |
@grundleborg any thoughts? |
@bradhowes looks like you've got a gofmt failure in your changes to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. @crspeller, you might want to take a look at this
Just updated to v3.7.0 and websockets are broken. Looking forward to getting this merged :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I think it will work, but can you prove it by updating the unit tests please? This is not something we want breaking in the future!
I've added tests that I believe cover the CORS settings. The tests revealed that the order of the arguments to the strings.contains call should be swapped, so I did. But that code I originally copied from the CORS support for regular HTTP connections. Note that I'm talking substring matching, not exact match. If exact match is all that is desired then the order of arguments would be immaterial. |
Looks good! Thanks! |
Follow-up from - https://mattermost.atlassian.net/browse/PLT-5635 - mattermost/mattermost#5667 - mattermost/mattermost#5386 Also fix two broken links
Summary
Honor 'AllowCorsFrom' config setting when upgrading HTTP sockets to web sockets.
This is a second attempt after the first had build errors (but none due to api/websocket.go) Merged with latest Mattermost master just to be safe. Sorry for the noise.
Ticket Link
None
Checklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]