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

Websocket protocol upgrade failed in firefox #85

Closed
fengyc opened this issue Jun 27, 2020 · 5 comments
Closed

Websocket protocol upgrade failed in firefox #85

fengyc opened this issue Jun 27, 2020 · 5 comments

Comments

@fengyc
Copy link

fengyc commented Jun 27, 2020

Firefox sends header Connection: keep-alive, Upgrade, that the check_header function could not handle.

let mut check_header = |name, expected| {
let actual = header(name)?;
if actual.eq_ignore_ascii_case(expected) {
Ok(())
} else {
Err(format!(
"client provided incorrect {name} header: expected {expected}, got {actual}",
name = name,
expected = expected,
actual = actual
))
}
};
check_header("Upgrade", "websocket")?;
check_header("Connection", "Upgrade")?;

actual.eq_ignore_ascii_case(expected) should be replaced with containsXXX.

@1tgr
Copy link
Owner

1tgr commented Jun 27, 2020

Thanks! This is the standard Firefox websocket client talking to the Rust server?

@fengyc
Copy link
Author

fengyc commented Jun 27, 2020

Yes, the latest firefox 77.0.1.

@1tgr
Copy link
Owner

1tgr commented Jun 27, 2020

I pushed a change to the firefox branch that fixes it for me. Are you able to test it on the branch before I make a release to crates.io?

@fengyc
Copy link
Author

fengyc commented Jun 28, 2020

Tested. Works for me.

@1tgr 1tgr closed this as completed in ba1f935 Jun 28, 2020
@1tgr
Copy link
Owner

1tgr commented Jun 28, 2020

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