comparison http/src/luan/modules/http/Http_test.luan @ 539:473e456444ff

Remove object-oriented primitive methods for string and binary
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 01 Jun 2015 17:53:55 -0600
parents 9218f9cf45d3
children cd944b010f25
comparison
equal deleted inserted replaced
538:919b9410008e 539:473e456444ff
1 local Io = require "luan:Io" 1 local Io = require "luan:Io"
2 local String = require "luan:String"
3 local matches = String.matches
2 local Http = require "luan:http/Http" 4 local Http = require "luan:http/Http"
3 5
4 local M = {} 6 local M = {}
5 7
6 M.welcome_file = "index.html" 8 M.welcome_file = "index.html"
7 M.cookie = {} 9 M.cookie = {}
8 10
9 function M.get_page(path) 11 function M.get_page(path)
10 if M.welcome_file ~= nil and path.matches ".*/" then 12 if M.welcome_file ~= nil and matches(path,".*/") then
11 path = path .. M.welcome_file 13 path = path .. M.welcome_file
12 end 14 end
13 local old_out = Io.stdout 15 local old_out = Io.stdout
14 local mod = require("site:"..path) 16 local mod = require("site:"..path)
15 mod() 17 mod()