From bb47916ebec6c44abfb88103e23d589ddef89702 Mon Sep 17 00:00:00 2001 From: Greg Johnston Date: Sat, 12 Apr 2025 20:29:43 -0400 Subject: [PATCH] fix: call `additional_context` after providing other server context in all cases (#3841) --- integrations/actix/src/lib.rs | 2 +- integrations/axum/src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/integrations/actix/src/lib.rs b/integrations/actix/src/lib.rs index 88ae2d2d2..2851f24e4 100644 --- a/integrations/actix/src/lib.rs +++ b/integrations/actix/src/lib.rs @@ -352,10 +352,10 @@ pub fn handle_server_fns_with_context( owner .with(|| { ScopedFuture::new(async move { - additional_context(); provide_context(Request::new(&req)); let res_options = ResponseOptions::default(); provide_context(res_options.clone()); + additional_context(); // store Accepts and Referer in case we need them for redirect (below) let accepts_html = req diff --git a/integrations/axum/src/lib.rs b/integrations/axum/src/lib.rs index c4b561b1f..8d181f1f1 100644 --- a/integrations/axum/src/lib.rs +++ b/integrations/axum/src/lib.rs @@ -381,10 +381,10 @@ async fn handle_server_fns_inner( owner .with(|| { ScopedFuture::new(async move { - additional_context(); provide_context(parts); let res_options = ResponseOptions::default(); provide_context(res_options.clone()); + additional_context(); // store Accepts and Referer in case we need them for redirect (below) let accepts_html = req @@ -2053,8 +2053,8 @@ where } else { let mut res = handle_response_inner( move || { - additional_context(); provide_context(state.clone()); + additional_context(); }, move || shell(options), req,