From 2c9d2dea0e9b4dd12e4731535fd3250d0aef9df9 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Sun, 12 Feb 2023 00:36:40 +0100 Subject: [PATCH] Upgrade dependencies (#1746) --- axum-extra/Cargo.toml | 2 +- axum/Cargo.toml | 2 +- axum/src/extract/ws.rs | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/axum-extra/Cargo.toml b/axum-extra/Cargo.toml index a6dec511..8758b8fc 100644 --- a/axum-extra/Cargo.toml +++ b/axum-extra/Cargo.toml @@ -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 } diff --git a/axum/Cargo.toml b/axum/Cargo.toml index 529d30f6..6d8bb58c 100644 --- a/axum/Cargo.toml +++ b/axum/Cargo.toml @@ -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 } diff --git a/axum/src/extract/ws.rs b/axum/src/extract/ws.rs index ec50742b..8c5e6f9a 100644 --- a/axum/src/extract/ws.rs +++ b/axum/src/extract/ws.rs @@ -670,10 +670,12 @@ impl From for Vec { } 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") }