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

http: Fix WebSockets with Firefox #1550

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ac000
Copy link
Member

@ac000 ac000 commented Jan 27, 2025

    http: Fix WebSockets with Firefox
    
    Firefox (134 at least) was unable to open a WebSocket connection to Unit
    due to it sending a Connection header of
    
      Connection: keep-alive, Upgrade
    
    However in Unit we were expecting only a single value in the header.
    
    Fix the 'Connection' parsing in nxt_h1p_connection() to address this.
    
    We keep the check for 'close' basically the same as that really should
    be the only value.
    
    Then we check for both of 'keep-alive' and 'upgrade'.
    
    Closes: https://github.com/nginx/unit/issues/772
    Signed-off-by: Andrew Clayton <[email protected]>

Firefox (134 at least) was unable to open a WebSocket connection to Unit
due to it sending a Connection header of

  Connection: keep-alive, Upgrade

However in Unit we were expecting only a single value in the header.

Fix the 'Connection' parsing in nxt_h1p_connection() to address this.

We keep the check for 'close' basically the same as that really should
be the only value.

Then we check for both of 'keep-alive' and 'upgrade'.

Closes: nginx#772
Signed-off-by: Andrew Clayton <[email protected]>
@ac000 ac000 marked this pull request as ready for review January 27, 2025 18:01
@ac000 ac000 requested review from hongzhidao and avahahn January 27, 2025 18:02
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.

1 participant