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

add warn log to from_parts if given request is cloned

closes #2562
This commit is contained in:
Rob Ede
2022-01-19 22:23:53 +00:00
parent 1bc1538118
commit 81ef12a0fd
3 changed files with 42 additions and 8 deletions

View File

@ -302,13 +302,13 @@ impl ToTokens for Route {
if methods.len() > 1 {
quote! {
.guard(
actix_web::guard::Any(actix_web::guard::#first())
#(.or(actix_web::guard::#others()))*
::actix_web::guard::Any(::actix_web::guard::#first())
#(.or(::actix_web::guard::#others()))*
)
}
} else {
quote! {
.guard(actix_web::guard::#first())
.guard(::actix_web::guard::#first())
}
}
};
@ -318,17 +318,17 @@ impl ToTokens for Route {
#[allow(non_camel_case_types, missing_docs)]
pub struct #name;
impl actix_web::dev::HttpServiceFactory for #name {
impl ::actix_web::dev::HttpServiceFactory for #name {
fn register(self, __config: &mut actix_web::dev::AppService) {
#ast
let __resource = actix_web::Resource::new(#path)
let __resource = ::actix_web::Resource::new(#path)
.name(#resource_name)
#method_guards
#(.guard(actix_web::guard::fn_guard(#guards)))*
#(.guard(::actix_web::guard::fn_guard(#guards)))*
#(.wrap(#wrappers))*
.#resource_type(#name);
actix_web::dev::HttpServiceFactory::register(__resource, __config)
::actix_web::dev::HttpServiceFactory::register(__resource, __config)
}
}
};