Skip to content

Commit

Permalink
Update base64 requirement from 0.13 to 0.21 (#608)
Browse files Browse the repository at this point in the history
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](marshallpierce/rust-base64@v0.13.0...v0.21.0)

---
updated-dependencies:
- dependency-name: base64
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dominic <git@msrd0.de>
  • Loading branch information
dependabot[bot] and msrd0 committed Jan 9, 2023
1 parent fde750e commit 3da82b6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/websocket/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
3 changes: 2 additions & 1 deletion examples/websocket/src/ws.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use base64::prelude::*;
use gotham::hyper::header::{
HeaderValue, CONNECTION, SEC_WEBSOCKET_ACCEPT, SEC_WEBSOCKET_KEY, UPGRADE,
};
Expand Down Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion gotham/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion gotham/src/middleware/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -847,7 +848,7 @@ where
};

SessionIdentifier {
value: base64::encode_config(&bytes[..], base64::URL_SAFE_NO_PAD),
value: BASE64_URL_SAFE_NO_PAD.encode(&bytes[..]),
}
}
}
Expand Down

0 comments on commit 3da82b6

Please sign in to comment.