diff options
author | Richard Ipsum <richard.ipsum@codethink.co.uk> | 2014-02-17 19:11:26 +0000 |
---|---|---|
committer | Richard Ipsum <richard.ipsum@codethink.co.uk> | 2014-02-17 19:11:26 +0000 |
commit | 96cd1699b57d9bdeab9f31296fb30b5b146da930 (patch) | |
tree | 7b154e7a0e214c2bf29b3d718ffcd07036b8e93f | |
parent | 7948518f22b4ea9018d0e34a7a529b31313bd544 (diff) | |
download | gitano-baserock/richardipsum/http_v3_br.tar.gz |
Use luxio's stdout in gitano-smart-httpbaserock/richardipsum/http_v3_br
-rwxr-xr-x | bin/gitano-smart-http.cgi.in | 17 |
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 |