Added some test code to lua/test.lua.
This commit is contained in:
parent
f50eb8c62c
commit
64b54dd697
1 changed files with 15 additions and 1 deletions
16
lua/test.lua
16
lua/test.lua
|
|
@ -4,7 +4,8 @@ permalink: /cgi/lua/test.lua
|
||||||
|
|
||||||
package.path = '{{ site.libdir }}/lua/?.lua;' .. package.path
|
package.path = '{{ site.libdir }}/lua/?.lua;' .. package.path
|
||||||
|
|
||||||
require('xw3.session')
|
require('xw3.http')
|
||||||
|
--require('xw3.session')
|
||||||
|
|
||||||
--[=====[
|
--[=====[
|
||||||
A multiline comment...
|
A multiline comment...
|
||||||
|
|
@ -12,6 +13,7 @@ A multiline comment...
|
||||||
|
|
||||||
print('Cache-control: no-cache')
|
print('Cache-control: no-cache')
|
||||||
print('Pragma: no-cache')
|
print('Pragma: no-cache')
|
||||||
|
print('Set-Cookie: HANNES=HANNES; expires=Mon, 17-Jul-2055 16:06:00 GMT; Max-Age=31449600; Path=/; secure')
|
||||||
print('Content-type: text/plain; charset=utf-8')
|
print('Content-type: text/plain; charset=utf-8')
|
||||||
print()
|
print()
|
||||||
|
|
||||||
|
|
@ -29,4 +31,16 @@ print(os.execute('/usr/bin/env | /usr/bin/sort'))
|
||||||
print()
|
print()
|
||||||
--print(debug.traceback("Stack trace"))
|
--print(debug.traceback("Stack trace"))
|
||||||
--print(debug.getinfo(1))
|
--print(debug.getinfo(1))
|
||||||
|
print('HTTP_COOKIE:')
|
||||||
|
print(os.getenv("HTTP_COOKIE"))
|
||||||
|
print()
|
||||||
|
|
||||||
|
local input = os.getenv("HTTP_COOKIE")
|
||||||
|
|
||||||
|
local cookies = parse_cookies(input)
|
||||||
|
|
||||||
|
for k, v in pairs(cookies) do
|
||||||
|
print(k, v)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue