diff options
author | bptato <nincsnevem662@gmail.com> | 2023-12-21 18:19:44 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-12-21 18:19:44 +0100 |
commit | aad2c9860410cdbe0a80b48aba74437994cfd3e1 (patch) | |
tree | 3147d451b902e5e68e37914c34391a46db3933e8 /src/loader/cgi.nim | |
parent | 98fd959625c2f9227066fdd43590af12c8f40e91 (diff) | |
download | chawan-aad2c9860410cdbe0a80b48aba74437994cfd3e1.tar.gz |
cgi: return ConnectionError when script is not executable
Diffstat (limited to 'src/loader/cgi.nim')
-rw-r--r-- | src/loader/cgi.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/loader/cgi.nim b/src/loader/cgi.nim index dfe66e22..467e2087 100644 --- a/src/loader/cgi.nim +++ b/src/loader/cgi.nim @@ -211,7 +211,8 @@ proc loadCGI*(handle: LoaderHandle, request: Request, cgiDir: seq[string], setupEnv(cmd, scriptName, pathInfo, requestURI, request, contentLen, prevURL) discard execl(cstring(cmd), cstring(basename), nil) - stdout.write("Content-Type: text/plain\r\n\r\nFailed to execute script.") + let code = int(ERROR_FAILED_TO_EXECUTE_CGI_SCRIPT) + stdout.write("Cha-Control: ConnectionError " & $code) quit(1) else: discard close(pipefd[1]) # close write |