Skip to content

Commit

Permalink
Upgrade dependencies (#1746)
Browse files Browse the repository at this point in the history
  • Loading branch information
jplatte committed Feb 11, 2023
1 parent 37922ab commit 2c9d2de
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion axum-extra/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ form_urlencoded = { version = "1.1.0", optional = true }
percent-encoding = { version = "2.1", optional = true }
prost = { version = "0.11", optional = true }
serde = { version = "1.0", optional = true }
serde_html_form = { version = "0.1", optional = true }
serde_html_form = { version = "0.2.0", optional = true }
serde_json = { version = "1.0.71", optional = true }
tokio-stream = { version = "0.1.9", optional = true }
tokio-util = { version = "0.7", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion axum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ tower-service = "0.3"

# optional dependencies
axum-macros = { path = "../axum-macros", version = "0.3.3", optional = true }
base64 = { version = "0.20", optional = true }
base64 = { version = "0.21.0", optional = true }
headers = { version = "0.3.7", optional = true }
multer = { version = "2.0.0", optional = true }
serde_json = { version = "1.0", features = ["raw_value"], optional = true }
Expand Down
4 changes: 3 additions & 1 deletion axum/src/extract/ws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -670,10 +670,12 @@ impl From<Message> for Vec<u8> {
}

fn sign(key: &[u8]) -> HeaderValue {
use base64::engine::Engine as _;

let mut sha1 = Sha1::default();
sha1.update(key);
sha1.update(&b"258EAFA5-E914-47DA-95CA-C5AB0DC85B11"[..]);
let b64 = Bytes::from(base64::encode(sha1.finalize()));
let b64 = Bytes::from(base64::engine::general_purpose::STANDARD.encode(sha1.finalize()));
HeaderValue::from_maybe_shared(b64).expect("base64 is a valid value")
}

Expand Down

0 comments on commit 2c9d2de

Please sign in to comment.