diff --git a/yqtemplate.lua b/yqtemplate.lua index 6636e5f..018be51 100644 --- a/yqtemplate.lua +++ b/yqtemplate.lua @@ -8,8 +8,15 @@ local form = etlua.compile(yqtemplateform) return { desc = "Creates Yokoka’s quest-style personal status page", run = function(fcgi) - fcgi.print("Content-Type: text/html; charset=utf-8\r\n\r\n") - local data = fcgi.post() - fcgi.print(form({data = data})) + fcgi.print("Content-Type: text/html; charset=utf-8\r\n\r\n") + local data = "" + if fcgi.getenv("REQUEST_METHOD") == "POST" then + --- @type string + local content_type = fcgi.getenv("CONTENT_TYPE") + local boundary = content_type:match("; boundary=(.*)$") + -- local post_data = fcgi.post() + data = "Content type:" .. content_type .. "\n Boundary: "..boundary.."\n" + end + fcgi.print(form{data = data}) end }