diff options
author | gennyble <gen@nyble.dev> | 2025-03-22 15:42:48 -0500 |
---|---|---|
committer | gennyble <gen@nyble.dev> | 2025-03-22 15:42:48 -0500 |
commit | 62d3ce6cca2d6be9f8fb77cc7e56a25217070d87 (patch) | |
tree | e16bc9affb18f442c85edb38706e4fadfbbdc5e6 | |
parent | f016a3d27e47076bfd367285c003478d990e08bb (diff) | |
download | corgi-62d3ce6cca2d6be9f8fb77cc7e56a25217070d87.tar.gz corgi-62d3ce6cca2d6be9f8fb77cc7e56a25217070d87.zip |
oops, need to pass http and custom env to module cgi
-rw-r--r-- | corgi/src/caller.rs | 11 |
1 files 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<CgiResponse>) { - 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(), ]); } |