From 3da82b63e36db81f73f0d88b7610a3979c62289a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jan 2023 13:17:49 +0100 Subject: [PATCH] Update base64 requirement from 0.13 to 0.21 (#608) Updates the requirements on [base64](https://github.com/marshallpierce/rust-base64) to permit the latest version. - [Release notes](https://github.com/marshallpierce/rust-base64/releases) - [Changelog](https://github.com/marshallpierce/rust-base64/blob/master/RELEASE-NOTES.md) - [Commits](https://github.com/marshallpierce/rust-base64/compare/v0.13.0...v0.21.0) --- updated-dependencies: - dependency-name: base64 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dominic --- examples/websocket/Cargo.toml | 2 +- examples/websocket/src/ws.rs | 3 ++- gotham/Cargo.toml | 2 +- gotham/src/middleware/session/mod.rs | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/websocket/Cargo.toml b/examples/websocket/Cargo.toml index 18b417ce..079474ae 100644 --- a/examples/websocket/Cargo.toml +++ b/examples/websocket/Cargo.toml @@ -13,4 +13,4 @@ tokio-tungstenite = "0.18" tokio = "1.11.0" pretty_env_logger = "0.4" sha1 = "0.10" -base64 = "0.13" +base64 = "0.21" diff --git a/examples/websocket/src/ws.rs b/examples/websocket/src/ws.rs index 8ffe7494..a704dfc2 100644 --- a/examples/websocket/src/ws.rs +++ b/examples/websocket/src/ws.rs @@ -1,3 +1,4 @@ +use base64::prelude::*; use gotham::hyper::header::{ HeaderValue, CONNECTION, SEC_WEBSOCKET_ACCEPT, SEC_WEBSOCKET_KEY, UPGRADE, }; @@ -57,7 +58,7 @@ fn accept_key(key: &[u8]) -> String { let mut sha1 = Sha1::default(); sha1.update(key); sha1.update(WS_GUID); - base64::encode(&sha1.finalize()) + BASE64_STANDARD.encode(&sha1.finalize()) } #[cfg(test)] diff --git a/gotham/Cargo.toml b/gotham/Cargo.toml index bd476ed8..e9621f20 100644 --- a/gotham/Cargo.toml +++ b/gotham/Cargo.toml @@ -30,7 +30,7 @@ borrow-bag = { path = "../misc/borrow_bag", version = "1.1" } gotham_derive = { path = "../gotham_derive", version = "0.7", optional = true } anyhow = "1.0" -base64 = "0.13" +base64 = "0.21" bincode = { version = "1.0", optional = true } bytes = "1.0" cookie = "0.15" diff --git a/gotham/src/middleware/session/mod.rs b/gotham/src/middleware/session/mod.rs index d261fa01..ec237e67 100644 --- a/gotham/src/middleware/session/mod.rs +++ b/gotham/src/middleware/session/mod.rs @@ -8,6 +8,7 @@ use std::panic::RefUnwindSafe; use std::pin::Pin; use std::sync::{Arc, Mutex, PoisonError}; +use base64::prelude::*; use cookie::{Cookie, CookieJar}; use futures_util::future::{self, FutureExt, TryFutureExt}; use hyper::header::SET_COOKIE; @@ -847,7 +848,7 @@ where }; SessionIdentifier { - value: base64::encode_config(&bytes[..], base64::URL_SAFE_NO_PAD), + value: BASE64_URL_SAFE_NO_PAD.encode(&bytes[..]), } } }