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

Verify if is a websocket connection #1443

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MauroAntonino
Copy link

Now, every HTTP request is handled as if it were a WebSocket connection. However, when an HTTP request is made and is expected to close the connection, an error arises because it is not supposed to receive an HTTP connection in the handler.

This PR verifies if it is actually a WebSocket connection before handling it.

@davidawesome02
Copy link

I may be wrong; but according to mozilla the upgrade header can be used for http requests, not just switching to websockets, so it should be explicitly checked for the upgrade to websocket.

This feature seams to be generally unused and depreciated, so in most cases should not matter.

@MauroAntonino
Copy link
Author

Yes, you are right. It must check if the header has the websocket string explicitly. I made a commit to fix right now.

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.

None yet

2 participants