fix: add response headers for leptos_axum static files #4377 (#4394)

This commit is contained in:
tqq1994516
2025-11-23 02:11:53 +08:00
committed by GitHub
parent 629f4f9d0f
commit e6fe7fef07
2 changed files with 36 additions and 3 deletions

View File

@@ -2050,7 +2050,20 @@ where
let res = res.await.unwrap();
if res.status() == StatusCode::OK {
res.into_response()
let owner = Owner::new();
owner.with(|| {
additional_context();
let res = res.into_response();
if let Some(response_options) =
use_context::<ResponseOptions>()
{
let mut res = AxumResponse(res);
res.extend_response(&response_options);
res.0
} else {
res
}
})
} else {
let mut res = handle_response_inner(
move || {