Mercurial Hosting > luan
view http/src/luan/modules/http/Http.luan @ 496:c65df5b25932
remove Http.session
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sat, 16 May 2015 20:19:05 -0600 |
parents | 598123096772 |
children | 55f9f74f1e55 |
line wrap: on
line source
local Io = require "luan:Io" function init_for_test() welcome_file = "index.html" function get_page(path) if welcome_file ~= nil and path.matches ".*/" then path = path .. welcome_file end local old_out = Io.stdout local mod = require("site:"..path) mod.respond() text_writer.close() Io.stdout = old_out return result.read_text() end cookies = cookies or {} request = { parameters = {}; } request.cookies = cookies response = { text_writer = function() result = Io.uri "string:" text_writer = result.text_writer() return text_writer end; set_cookie = function(name,value) cookies[name] = value end; remove_cookie = function(name) cookies[name] = nil end; send_redirect = function(url) response.redirect = url end; headers = {}; } end