1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-26 06:57:43 +02:00

fix: wrap attribute codegen regression when using expression (#3119)

This commit is contained in:
Rob Ede
2023-08-29 21:27:36 +01:00
committed by GitHub
parent 39abe3ae5e
commit 76f6106f8f
6 changed files with 29 additions and 12 deletions

View File

@ -212,6 +212,19 @@ async fn get_wrap(_: web::Path<String>) -> impl Responder {
HttpResponse::Ok()
}
/// Using expression, not just path to type, in wrap attribute.
///
/// Regression from <https://github.com/actix/actix-web/issues/3118>.
#[route(
"/catalog",
method = "GET",
method = "HEAD",
wrap = "actix_web::middleware::Compress::default()"
)]
async fn get_catalog() -> impl Responder {
HttpResponse::Ok().body("123123123")
}
#[actix_rt::test]
async fn test_params() {
let srv = actix_test::start(|| {

View File

@ -38,7 +38,7 @@ error: Multiple paths specified! There should be only one.
|
= note: this error originates in the attribute macro `delete` (in Nightly builds, run with -Z macro-backtrace for more info)
error: HTTP method forbidden here. To handle multiple methods, use `route` instead
error: HTTP method forbidden here; to handle multiple methods, use `route` instead
--> $DIR/simple-fail.rs:25:19
|
25 | #[delete("/five", method="GET")]