mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Auto merge of #21436 - Eijebong:ws-protocols, r=jdm
The WS protocols should be case sensitive, not insensitive <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21436) <!-- Reviewable:end -->
This commit is contained in:
commit
cfae377660
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