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

Upgrade to latest websock_adapter, handle upgrade failures & report 400 #5621

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

mtrudel
Copy link
Member

@mtrudel mtrudel commented Nov 1, 2023

Hot on the heels of phoenixframework/websock_adapter#14, handle upgrade errors and return 400 errors to the client, enabling folks to more easily connect upgrade failures with the client that causes them

@jeregrine
Copy link
Member

@mtrudel does this match the behavior of cowboy? So its strictly backwards compatible?

@mtrudel
Copy link
Member Author

mtrudel commented Nov 1, 2023

Not entirely; Cowboy returns 426 for failed HTTP/1 upgrades, but this is strictly incorrect (426 indicates that the current protocol is unsuitable for upgrading, not that the upgrade itself is incorrect). See RFC9110§15.5.22.

Bandit returns a 400 in this case.

@josevalim josevalim merged commit bd63cf3 into phoenixframework:main Nov 2, 2023
4 checks passed
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

@mtrudel mtrudel deleted the websocket_error_handling branch November 2, 2023 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants