Software /
code /
prosody
Comparison
net/http.lua @ 1112:e8a00a2ea910
Merge with 0.4
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 04 May 2009 19:57:05 +0100 |
parent | 1037:cb5fdce8dcec |
parent | 1111:a1cf1d623695 |
child | 1331:4443309b5528 |
comparison
equal
deleted
inserted
replaced
1103:b78b1524eb79 | 1112:e8a00a2ea910 |
---|---|
13 tonumber, tostring, pairs, xpcall, select, debug.traceback, string.char; | 13 tonumber, tostring, pairs, xpcall, select, debug.traceback, string.char; |
14 | 14 |
15 local log = require "util.logger".init("http"); | 15 local log = require "util.logger".init("http"); |
16 local print = function () end | 16 local print = function () end |
17 | 17 |
18 local urlcodes = setmetatable({}, { __index = function (t, k) t[k] = char(tonumber("0x"..k)); return t[k]; end }); | |
19 local urlencode = function (s) return s and (s:gsub("%W", function (c) return string.format("%%%02x", c:byte()); end)); end | 18 local urlencode = function (s) return s and (s:gsub("%W", function (c) return string.format("%%%02x", c:byte()); end)); end |
20 | 19 |
21 module "http" | 20 module "http" |
22 | 21 |
23 local function expectbody(reqt, code) | 22 local function expectbody(reqt, code) |