diff options
author | Bastien Orivel <eijebong@bananium.fr> | 2018-08-16 14:37:18 +0200 |
---|---|---|
committer | Bastien Orivel <eijebong@bananium.fr> | 2018-08-16 15:50:50 +0200 |
commit | 75c746655cc1ae92d3841b92b2fe2d127a052de3 (patch) | |
tree | 71cc5eb0571f30a222573f0b2e67b92f625e44e9 /components/net/websocket_loader.rs | |
parent | 89ab110357cae21043f8f70f01ddf8f72c18f863 (diff) | |
download | servo-75c746655cc1ae92d3841b92b2fe2d127a052de3.tar.gz servo-75c746655cc1ae92d3841b92b2fe2d127a052de3.zip |
The WS protocols should be case sensitive, not insensitive
Diffstat (limited to 'components/net/websocket_loader.rs')
-rw-r--r-- | components/net/websocket_loader.rs | 6 |
1 files changed, 3 insertions, 3 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(()) } |