2024-08-22 13:37:32 +01:00
|
|
|
#![allow(unused_macros, unused_imports)]
|
|
|
|
|
2024-07-28 17:41:16 +01:00
|
|
|
macro_rules! get_header {
|
|
|
|
(
|
2024-08-13 16:19:19 +01:00
|
|
|
$header_name:expr,
|
2024-07-28 17:41:16 +01:00
|
|
|
$function_name:ident,
|
|
|
|
$option_name:ident
|
|
|
|
$(,)?
|
|
|
|
) => {
|
|
|
|
if cfg!(feature = "ssr") {
|
|
|
|
#[cfg(all(
|
|
|
|
not(feature = "axum"),
|
|
|
|
not(feature = "actix"),
|
|
|
|
not(feature = "spin")
|
|
|
|
))]
|
|
|
|
{
|
|
|
|
leptos::logging::warn!(
|
|
|
|
"If you're using `{}` with SSR but without any of the features `axum`, `actix` or `spin` enabled, you have to provide the option `{}`",
|
|
|
|
stringify!($function_name),
|
|
|
|
stringify!($option_name)
|
|
|
|
);
|
|
|
|
return None;
|
|
|
|
}
|
2024-08-14 03:43:00 +01:00
|
|
|
|
2024-07-28 17:41:16 +01:00
|
|
|
#[cfg(feature = "actix")]
|
2024-08-13 16:19:19 +01:00
|
|
|
#[allow(unused_imports)]
|
|
|
|
use http0_2::{HeaderName, header::*};
|
2024-07-28 17:41:16 +01:00
|
|
|
#[cfg(any(feature = "axum", feature = "spin"))]
|
2024-08-13 16:19:19 +01:00
|
|
|
#[allow(unused_imports)]
|
|
|
|
use http1::{HeaderName, header::*};
|
2024-07-28 17:41:16 +01:00
|
|
|
|
|
|
|
#[cfg(any(feature = "axum", feature = "actix", feature = "spin"))]
|
2024-08-13 16:19:19 +01:00
|
|
|
{
|
|
|
|
let header_name = $header_name;
|
|
|
|
crate::utils::header(header_name)
|
|
|
|
}
|
2024-07-28 17:41:16 +01:00
|
|
|
} else {
|
|
|
|
None
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
pub(crate) use get_header;
|