aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorheav-4 <heavpoot@gmail.com>2022-02-25 23:55:05 +0000
committerheav-4 <heavpoot@gmail.com>2022-02-25 23:55:05 +0000
commitb323e840eaf48a131a7a6bbf6a727289673a19cf (patch)
tree5c3d016237e9bc50f0307cae47f8ffc30f885040
parentee8b4e7d4bb2140d5a19bc1dc95a12fa642a786c (diff)
parentc705afac8659e74fffd263a5468336d4fab87961 (diff)
fix merge conflict
-rwxr-xr-xzzcxz.cgi37
1 files changed, 36 insertions, 1 deletions
diff --git a/zzcxz.cgi b/zzcxz.cgi
index f722b1b..a650e98 100755
--- a/zzcxz.cgi
+++ b/zzcxz.cgi
@@ -92,12 +92,20 @@ local function parse_qs(str,sep)
return values
end
+<<<<<<< HEAD
local cookies = env "HTTP_COOKIE" and parse_qs(env "HTTP_COOKIE","; ") or {}
local flags = {}
for k,v in pairs(cookies) do
local flag = k:match "flag_(.+)"
if flag then
flags[flag] = v
+=======
+local cookies = parse_qs(env "HTTP_COOKIE", "; ")
+local flags = {}
+for k, v in pairs(cookies) do
+ if k:sub(1,5) == "flag_" then
+ flags[k:sub(6)] = v
+>>>>>>> master
end
end
@@ -151,6 +159,7 @@ local not_found = function()
end
local function parse_directive(line, directives)
+ flags = flags or {}
local directive, args = line:match "^#([A-Za-z]+)%s*(.-)\n?$"
directive = directive and directive:lower()
if not directive then
@@ -187,7 +196,12 @@ end
local load_page
local function convert_markup(m)
local result = {}
+<<<<<<< HEAD
local directives = {flags_updated = {}}
+=======
+ local directives = {}
+ directives.flags = {}
+>>>>>>> master
local code_block = false
for line in (m..'\n'):gmatch "(.-)\n" do
if not code_block then
@@ -195,7 +209,7 @@ local function convert_markup(m)
goto continue
end
if line:sub(1,1) == '#' and
- parse_directive(line, directives) then
+ parse_directive(line, directives, flags) then
goto continue
end
@@ -327,6 +341,13 @@ map["^/g/(%w%w%w%w%w)$"] = function(p)
local page = load_page(p)
if not page then return not_found() end
local _, directives = convert_markup(page.content)
+<<<<<<< HEAD
+=======
+ local cookies = {}
+ for k,v in pairs(directives.flags) do
+ table.insert(cookies,"flag_"..k.."="..url_encode(v).."; Secure")
+ end
+>>>>>>> master
if env "REQUEST_METHOD" ~= "POST" then
local actions = {}
for _,a in ipairs(page.actions) do
@@ -363,8 +384,13 @@ map["^/g/(%w%w%w%w%w)$"] = function(p)
title = html_encode(page.title),
content = convert_markup(page.content),
actions = table.concat(actions),
+<<<<<<< HEAD
}
}, {headers = {["set-cookie"] = cookies, bee = "apio form"}}
+=======
+ },
+ }, {headers = {["set-cookie"] = cookies, bees = "3.14"}}
+>>>>>>> master
else
if directives.deadend then
return base {
@@ -510,11 +536,20 @@ resp.content_type = resp.content_type or 'text/html'
resp.status = resp.status or '200 OK'
resp.headers = resp.headers or {}
resp.headers['content-type'] = resp.content_type
+<<<<<<< HEAD
resp.headers.apioform = 3.5
print("status: "..resp.status)
for k,v in pairs(resp.headers) do
if type(v) == "table" then
for _,v2 in ipairs(v) do
+=======
+resp.headers['apioforms'] = math.random(0,104942)/2
+
+print("status: "..resp.status)
+for k,v in pairs(resp.headers) do
+ if type(v) == "table" then
+ for _, v2 in ipairs(v) do
+>>>>>>> master
print(("%s: %s"):format(k, v2))
end
else