From 1573055d1383b500790da76f2cb1730d7dcec02a Mon Sep 17 00:00:00 2001 From: Annwan Date: Sun, 11 Aug 2024 22:27:53 +0200 Subject: [PATCH] [YQTemplate] add content type --- main.lua | 4 ++-- yqtemplate.lua | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) mode change 100644 => 100755 main.lua diff --git a/main.lua b/main.lua old mode 100644 new mode 100755 index e930f59..a20eedd --- a/main.lua +++ b/main.lua @@ -1,13 +1,13 @@ #!/usr/bin/env lua local fcgi = require"fcgi" -local yqtemplate = require"yqtemplate" +local app_yqtemplate = require"yqtemplate" while fcgi.accept() do app = fcgi.getenv("DOCUMENT_URI"):sub(6) if app = "yqtemplate" then - yqtemplate(fcgi) + app_yqtemplate(fcgi) else fcgi.print"Content-Type: text/plain; charset=utf-8\r\n\r\n" fcgi.print("Unknown CGI application: `" .. app .. "'\n") diff --git a/yqtemplate.lua b/yqtemplate.lua index 8166e72..11f3d56 100644 --- a/yqtemplate.lua +++ b/yqtemplate.lua @@ -1,3 +1,4 @@ return function(fcgi) - fcgi.print"Hello from application `YQTemplate'" + fcgi.print("Content-Type: text/plain; charset=utf-8\r\n\r\n") + fcgi.print("Hello from application `YQTemplate'") end