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

Websockets server API doesn't work with firefox 74 #203

Open
jakgra opened this issue Mar 24, 2020 · 1 comment
Open

Websockets server API doesn't work with firefox 74 #203

jakgra opened this issue Mar 24, 2020 · 1 comment

Comments

@jakgra
Copy link

jakgra commented Mar 24, 2020

Hi. First thanks for the great library, I really like it :) .

When running examples/webapp.c I noticed it doesn't work with firefox 74. The assert on ws_attach_server() (line 101) fails. The problem lies in the ws.c file on line 254.

libdill checks if the "Connection" header equals "Upgrade", but firefox sends "keep-alive, Upgrade" not only "Upgrade" as chrome and others do. The websockets standard (https://tools.ietf.org/html/rfc6455#section-4.2) specifies that the Connection must include a case-insensitive Upgrade value. So firefox correctly follows the standard, but libdill in this case doesn't.

If you are interested I'm happy to create a PR to fix this.

For the PR I see 2 options:

  1. follow the standard and check for substring and not equality
  2. don't check at all. There seem to be some proxy servers in the wild that don't correctly forward hop by hop headers. So the server only receives Connection: keep-alive, and not the whole Connection: keep-alive, Upgrade. See https://stackoverflow.com/questions/50192812/firefox-combining-connection-keep-alive-upgrade-conflicts-with-mobile-operat . So to support a wider audience of clients this is also an interesting option in my opinion.

If you are interested in a PR please specify which of the above 2 options you would like me to implement. Thanks.

@octetta
Copy link

octetta commented Aug 5, 2020

Thank you for debugging this issue and making notes.
I just spent the weekend re-writing a crummy Python monitoring system with libdill and ran into the Firefox issue well into the project.

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

No branches or pull requests

2 participants