From 62d3ce6cca2d6be9f8fb77cc7e56a25217070d87 Mon Sep 17 00:00:00 2001 From: gennyble Date: Sat, 22 Mar 2025 15:42:48 -0500 Subject: oops, need to pass http and custom env to module cgi --- corgi/src/caller.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/corgi/src/caller.rs b/corgi/src/caller.rs index 94b26aa..a8b04c0 100644 --- a/corgi/src/caller.rs +++ b/corgi/src/caller.rs @@ -197,13 +197,18 @@ pub async fn call_and_parse_module(script: Script, req: HttpRequest) -> CgiRespo } unsafe fn module_thread(script: Script, req: HttpRequest, tx: Sender) { - let env = req.build_kv(); + let env: Vec<(String, String)> = req + .build_kv() + .into_iter() + .chain(req.http_headers.into_iter()) + .chain(script.env.into_iter()) + .collect(); let mut headers_owned = vec![]; for (k, v) in env { headers_owned.push([ - CString::from_str(&k).unwrap(), - CString::from_str(&v).unwrap(), + CString::from_str(k.as_str()).unwrap(), + CString::from_str(v.as_str()).unwrap(), ]); } -- cgit 1.4.1-3-g733a5