aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/net/websocket_loader.rs6
-rw-r--r--tests/wpt/metadata/websockets/constructor/011.html.ini11
2 files changed, 3 insertions, 14 deletions
diff --git a/components/net/websocket_loader.rs b/components/net/websocket_loader.rs
index 2f6dcf5b768..5a676c904ad 100644
--- a/components/net/websocket_loader.rs
+++ b/components/net/websocket_loader.rs
@@ -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(())
}
diff --git a/tests/wpt/metadata/websockets/constructor/011.html.ini b/tests/wpt/metadata/websockets/constructor/011.html.ini
deleted file mode 100644
index 01f80aa2dbe..00000000000
--- a/tests/wpt/metadata/websockets/constructor/011.html.ini
+++ /dev/null
@@ -1,11 +0,0 @@
-[011.html]
- type: testharness
- [WebSockets: protocol mismatch]
- expected: FAIL
-
-
-[011.html?wss]
- type: testharness
- [WebSockets: protocol mismatch]
- expected: FAIL
-