mirror of
https://github.com/fafhrd91/actix-web
synced 2025-06-26 06:57:43 +02:00
build(deps): update rand requirement from 0.8 to 0.9 (#3564)
* build(deps): update rand requirement from 0.8 to 0.9 Updates the requirements on [rand](https://github.com/rust-random/rand) to permit the latest version. - [Release notes](https://github.com/rust-random/rand/releases) - [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-random/rand/compare/0.8.0...0.9.0) --- updated-dependencies: - dependency-name: rand dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> * chore: fix rand upgrade * chore: address clippy lint --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
@ -116,7 +116,7 @@ log =" 0.4"
|
||||
mime = "0.3"
|
||||
percent-encoding = "2.1"
|
||||
pin-project-lite = "0.2"
|
||||
rand = "0.8"
|
||||
rand = "0.9"
|
||||
serde = "1.0"
|
||||
serde_json = "1.0"
|
||||
serde_urlencoded = "0.7"
|
||||
|
@ -326,7 +326,7 @@ impl WebsocketsRequest {
|
||||
|
||||
// Generate a random key for the `Sec-WebSocket-Key` header which is a base64-encoded
|
||||
// (see RFC 4648 §4) value that, when decoded, is 16 bytes in length (RFC 6455 §1.3).
|
||||
let sec_key: [u8; 16] = rand::random();
|
||||
let sec_key = rand::random::<[u8; 16]>();
|
||||
let key = BASE64_STANDARD.encode(sec_key);
|
||||
|
||||
self.head.headers.insert(
|
||||
|
@ -20,7 +20,7 @@ use base64::prelude::*;
|
||||
use bytes::Bytes;
|
||||
use cookie::Cookie;
|
||||
use futures_util::stream;
|
||||
use rand::Rng;
|
||||
use rand::distr::{Alphanumeric, SampleString as _};
|
||||
|
||||
mod utils;
|
||||
|
||||
@ -516,11 +516,7 @@ async fn client_gzip_encoding_large() {
|
||||
#[cfg(feature = "compress-gzip")]
|
||||
#[actix_rt::test]
|
||||
async fn client_gzip_encoding_large_random() {
|
||||
let data = rand::thread_rng()
|
||||
.sample_iter(&rand::distributions::Alphanumeric)
|
||||
.take(100_000)
|
||||
.map(char::from)
|
||||
.collect::<String>();
|
||||
let data = Alphanumeric.sample_string(&mut rand::rng(), 100_000);
|
||||
|
||||
let srv = actix_test::start(|| {
|
||||
App::new().service(web::resource("/").route(web::to(|data: Bytes| async {
|
||||
@ -562,11 +558,7 @@ async fn client_brotli_encoding() {
|
||||
#[cfg(feature = "compress-brotli")]
|
||||
#[actix_rt::test]
|
||||
async fn client_brotli_encoding_large_random() {
|
||||
let data = rand::thread_rng()
|
||||
.sample_iter(&rand::distributions::Alphanumeric)
|
||||
.take(70_000)
|
||||
.map(char::from)
|
||||
.collect::<String>();
|
||||
let data = Alphanumeric.sample_string(&mut rand::rng(), 70_000);
|
||||
|
||||
let srv = actix_test::start(|| {
|
||||
App::new().service(web::resource("/").route(web::to(|data: Bytes| async {
|
||||
@ -607,11 +599,7 @@ async fn client_deflate_encoding() {
|
||||
|
||||
#[actix_rt::test]
|
||||
async fn client_deflate_encoding_large_random() {
|
||||
let data = rand::thread_rng()
|
||||
.sample_iter(rand::distributions::Alphanumeric)
|
||||
.map(char::from)
|
||||
.take(70_000)
|
||||
.collect::<String>();
|
||||
let data = Alphanumeric.sample_string(&mut rand::rng(), 70_000);
|
||||
|
||||
let srv = actix_test::start(|| {
|
||||
App::new().default_service(web::to(|body: Bytes| async {
|
||||
|
Reference in New Issue
Block a user