mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
The WS protocols should be case sensitive, not insensitive
This commit is contained in:
parent
89ab110357
commit
75c746655c
2 changed files with 3 additions and 14 deletions
|
@ -109,14 +109,14 @@ impl<'a> Handler for Client<'a> {
|
|||
|
||||
fn on_response(&mut self, res: &WsResponse) -> WebSocketResult<()> {
|
||||
let protocol_in_use = res.protocol()?;
|
||||
|
||||
if let Some(protocol_name) = protocol_in_use {
|
||||
let protocol_name = protocol_name.to_lowercase();
|
||||
if !self.protocols.is_empty() && !self.protocols.iter().any(|p| protocol_name == (*p).to_lowercase()) {
|
||||
if !self.protocols.is_empty() && !self.protocols.iter().any(|p| protocol_name == (*p)) {
|
||||
let error = WebSocketError::new(WebSocketErrorKind::Protocol,
|
||||
"Protocol in Use not in client-supplied protocol list");
|
||||
return Err(error);
|
||||
}
|
||||
self.protocol_in_use = Some(protocol_name);
|
||||
self.protocol_in_use = Some(protocol_name.into());
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
[011.html]
|
||||
type: testharness
|
||||
[WebSockets: protocol mismatch]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[011.html?wss]
|
||||
type: testharness
|
||||
[WebSockets: protocol mismatch]
|
||||
expected: FAIL
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue