Skip to content

Commit

Permalink
Field names in HTTP headers are case insensitive
Browse files Browse the repository at this point in the history
Closes #8
  • Loading branch information
1tgr committed Nov 22, 2019
1 parent 1065f50 commit 098b924
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion websocket-codec/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "websocket-codec"
description = "A Tokio codec for the websocket protocol"
version = "0.2.1-alpha.6"
version = "0.2.2-alpha.6"
authors = ["Tim Robinson <[email protected]>"]
repository = "https://github.com/1tgr/rust-websocket-lite"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion websocket-codec/src/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{Error, Result};
fn header<'a, 'header: 'a>(headers: &'a [Header<'header>], name: &'a str) -> result::Result<&'header [u8], String> {
let header = headers
.iter()
.find(|header| header.name == name)
.find(|header| header.name.eq_ignore_ascii_case(name))
.ok_or_else(|| format!("server didn't respond with {name} header", name = name))?;

Ok(header.value)
Expand Down
4 changes: 2 additions & 2 deletions websocket-lite/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "websocket-lite"
description = "A fast, low-overhead WebSocket client"
version = "0.3.1-alpha.6"
version = "0.3.2-alpha.6"
authors = ["Tim Robinson <[email protected]>"]
repository = "https://github.com/1tgr/rust-websocket-lite"
license = "MIT"
Expand Down Expand Up @@ -39,7 +39,7 @@ tokio-openssl = { version = "0.4.0-alpha.6", optional = true }
tokio-net = { version = "0.2.0-alpha.6", features = ["tcp"] }
tokio-tls = { version = "0.3.0-alpha.6", optional = true }
url = "2"
websocket-codec = { version = "0.2.1-alpha.6", path = "../websocket-codec" }
websocket-codec = { version = "0.2.2-alpha.6", path = "../websocket-codec" }

[dev-dependencies]
structopt = "0.3"
Expand Down
2 changes: 1 addition & 1 deletion websocket-lite/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ mod tests {
static RESPONSE: &'static str = "HTTP/1.1 101 Switching Protocols\r\n\
Upgrade: websocket\r\n\
Connection: Upgrade\r\n\
Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=\r\n\
sec-websocket-accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=\r\n\
\r\n";

#[test]
Expand Down

0 comments on commit 098b924

Please sign in to comment.