1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-26 10:27:42 +02:00

bump actix-web to 4.0.0-rc.1

This commit is contained in:
Rob Ede
2022-02-03 22:33:47 +00:00
parent 6abec48e29
commit 323d01fcca
27 changed files with 84 additions and 79 deletions

View File

@ -1,6 +1,7 @@
# Changes
## Unreleased - 2021-xx-xx
- Update `actix-web` dependency to `4.0.0-rc.1`.
## 0.6.0-beta.8 - 2021-12-29
@ -8,7 +9,7 @@
## 0.6.0-beta.7 - 2021-12-18
- Update `actix-web` dependency to `4.0.0.beta-15`. [#216]
- Update `actix-web` dependency to `4.0.0-beta.15`. [#216]
[#216]: https://github.com/actix/actix-extras/pull/216

View File

@ -19,7 +19,7 @@ path = "src/lib.rs"
[dependencies]
actix-service = "2"
actix-utils = "3"
actix-web = { version = "4.0.0-beta.17", default-features = false }
actix-web = { version = "4.0.0-rc.1", default-features = false }
derive_more = "0.99.5"
futures-util = { version = "0.3.7", default-features = false }
@ -28,6 +28,6 @@ once_cell = "1"
smallvec = "1.6.1"
[dev-dependencies]
actix-rt = "2"
actix-web = { version = "4.0.0-rc.2", default_features = false, features = ["macros"] }
env_logger = "0.9"
regex = "1.4"

View File

@ -597,7 +597,7 @@ mod test {
.is_err());
}
#[actix_rt::test]
#[actix_web::test]
async fn restrictive_defaults() {
let cors = Cors::default()
.new_transform(test::ok_service())
@ -612,12 +612,12 @@ mod test {
assert_eq!(resp.status(), StatusCode::BAD_REQUEST);
}
#[actix_rt::test]
#[actix_web::test]
async fn allowed_header_try_from() {
let _cors = Cors::default().allowed_header("Content-Type");
}
#[actix_rt::test]
#[actix_web::test]
async fn allowed_header_try_into() {
struct ContentType;
@ -632,7 +632,7 @@ mod test {
let _cors = Cors::default().allowed_header(ContentType);
}
#[actix_rt::test]
#[actix_web::test]
async fn middleware_generic_over_body_type() {
let srv = fn_service(|req: ServiceRequest| async move {
Ok(req.into_response(HttpResponse::with_body(StatusCode::OK, body::None::new())))

View File

@ -218,7 +218,7 @@ mod test {
val.to_str().unwrap()
}
#[actix_rt::test]
#[actix_web::test]
async fn test_validate_not_allowed_origin() {
let cors = Cors::default()
.allowed_origin("https://www.example.com")
@ -236,7 +236,7 @@ mod test {
assert!(cors.inner.validate_allowed_headers(req.head()).is_err());
}
#[actix_rt::test]
#[actix_web::test]
async fn test_preflight() {
let mut cors = Cors::default()
.allow_any_origin()

View File

@ -195,7 +195,7 @@ mod tests {
use super::*;
use crate::Cors;
#[actix_rt::test]
#[actix_web::test]
async fn test_options_no_origin() {
// Tests case where allowed_origins is All but there are validate functions to run incase.
// In this case, origins are only allowed when the DNT header is sent.

View File

@ -17,7 +17,7 @@ fn val_as_str(val: &HeaderValue) -> &str {
val.to_str().unwrap()
}
#[actix_rt::test]
#[actix_web::test]
#[should_panic]
async fn test_wildcard_origin() {
Cors::default()
@ -27,7 +27,7 @@ async fn test_wildcard_origin() {
.unwrap();
}
#[actix_rt::test]
#[actix_web::test]
async fn test_not_allowed_origin_fn() {
let cors = Cors::default()
.allowed_origin("https://www.example.com")
@ -73,7 +73,7 @@ async fn test_not_allowed_origin_fn() {
}
}
#[actix_rt::test]
#[actix_web::test]
async fn test_allowed_origin_fn() {
let cors = Cors::default()
.allowed_origin("https://www.example.com")
@ -118,7 +118,7 @@ async fn test_allowed_origin_fn() {
);
}
#[actix_rt::test]
#[actix_web::test]
async fn test_allowed_origin_fn_with_environment() {
let regex = Regex::new("https:.+\\.unknown\\.com").unwrap();
@ -165,7 +165,7 @@ async fn test_allowed_origin_fn_with_environment() {
);
}
#[actix_rt::test]
#[actix_web::test]
async fn test_multiple_origins_preflight() {
let cors = Cors::default()
.allowed_origin("https://example.com")
@ -204,7 +204,7 @@ async fn test_multiple_origins_preflight() {
);
}
#[actix_rt::test]
#[actix_web::test]
async fn test_multiple_origins() {
let cors = Cors::default()
.allowed_origin("https://example.com")
@ -239,7 +239,7 @@ async fn test_multiple_origins() {
);
}
#[actix_rt::test]
#[actix_web::test]
async fn test_response() {
let exposed_headers = vec![header::AUTHORIZATION, header::ACCEPT];
let cors = Cors::default()
@ -340,7 +340,7 @@ async fn test_response() {
assert_eq!(Some("https://www.example.com"), origins_str);
}
#[actix_rt::test]
#[actix_web::test]
async fn test_validate_origin() {
let cors = Cors::default()
.allowed_origin("https://www.example.com")
@ -356,7 +356,7 @@ async fn test_validate_origin() {
assert_eq!(resp.status(), StatusCode::OK);
}
#[actix_rt::test]
#[actix_web::test]
async fn test_no_origin_response() {
let cors = Cors::permissive()
.disable_preflight()
@ -384,7 +384,7 @@ async fn test_no_origin_response() {
);
}
#[actix_rt::test]
#[actix_web::test]
async fn validate_origin_allows_all_origins() {
let cors = Cors::permissive()
.new_transform(test::ok_service())
@ -399,7 +399,7 @@ async fn validate_origin_allows_all_origins() {
assert_eq!(resp.status(), StatusCode::OK);
}
#[actix_rt::test]
#[actix_web::test]
async fn test_allow_any_origin_any_method_any_header() {
let cors = Cors::default()
.allow_any_origin()