diff options
author | bptato <nincsnevem662@gmail.com> | 2024-03-21 17:45:55 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-03-21 17:45:55 +0100 |
commit | 9ff343c860fa4b109e139579146246b9a0d7a298 (patch) | |
tree | 1c44b0348166157c798d82c5411a94e6edcd74f7 /src/loader/loader.nim | |
parent | bdd482b0451f949870480d6d35be52953c08531a (diff) | |
download | chawan-9ff343c860fa4b109e139579146246b9a0d7a298.tar.gz |
loader: set static CGI env vars in initLoaderContext
no reason to do it separately in setupEnv
Diffstat (limited to 'src/loader/loader.nim')
-rw-r--r-- | src/loader/loader.nim | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/loader/loader.nim b/src/loader/loader.nim index 17677eb5..6cc37b71 100644 --- a/src/loader/loader.nim +++ b/src/loader/loader.nim @@ -702,6 +702,14 @@ proc initLoaderContext(fd: cint; config: LoaderConfig): LoaderContext = stream.close() # unblock main socket ctx.ssock.sock.getFd().setBlocking(false) + # for CGI + putEnv("SERVER_SOFTWARE", "Chawan") + putEnv("SERVER_PROTOCOL", "HTTP/1.0") + putEnv("SERVER_NAME", "localhost") + putEnv("SERVER_PORT", "80") + putEnv("REMOTE_HOST", "localhost") + putEnv("REMOTE_ADDR", "127.0.0.1") + putEnv("GATEWAY_INTERFACE", "CGI/1.1") return ctx # This is only called when an OutputHandle could not read enough of one (or |