summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/gitano-smart-http.cgi.in17
1 files changed, 10 insertions, 7 deletions
diff --git a/bin/gitano-smart-http.cgi.in b/bin/gitano-smart-http.cgi.in
index c86726c..ace3d9f 100755
--- a/bin/gitano-smart-http.cgi.in
+++ b/bin/gitano-smart-http.cgi.in
@@ -14,10 +14,13 @@ local gitano = require "gitano"
local gall = require "gall"
local luxio = require "luxio"
local subprocess = require "luxio.subprocess"
+local sio = require "luxio.simple"
-- @@GITANO_BIN_PATH
-- @@GITANO_SHARE_PATH
+local stdout = sio.stdout
+
function parse_get_request()
query_string = os.getenv("QUERY_STRING")
@@ -62,15 +65,15 @@ if request_method == "GET" or request_method == "POST" then
_, exit_code = proc:wait()
if exit_code ~= 0 then
- io.write("Status: 500 Internal Server Error\r\n\r\n")
- io.flush()
+ stdout:write("Status: 500 Internal Server Error\r\n\r\n")
+ stdout:flush()
end
else
- io.write("Status: 403 Forbidden\r\n\r\n")
- io.flush()
+ stdout:write("Status: 403 Forbidden\r\n\r\n")
+ stdout:flush()
end
else
- io.write("Status: 405 Method Not Allowed\r\n")
- io.write("Allow: GET, POST\r\n\r\n")
- io.flush()
+ stdout:write("Status: 405 Method Not Allowed\r\n")
+ stdout:write("Allow: GET, POST\r\n\r\n")
+ stdout:flush()
end