Browse Source

Parsing boundaries in form data

main
Annwan 4 months ago
parent
commit
7ddc5a142d
  1. 13
      yqtemplate.lua

13
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
}
Loading…
Cancel
Save