diff options
-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(), ]); } |