Software / code / prosody
Comparison
net/httpserver.lua @ 1113:89ac8e9e1426
net.httpserver: Fix for urlencoding to always produce 2 digits
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Mon, 04 May 2009 20:35:44 +0100 |
| parent | 1111:a1cf1d623695 |
| child | 1119:61a011ebe243 |
comparison
equal
deleted
inserted
replaced
| 1111:a1cf1d623695 | 1113:89ac8e9e1426 |
|---|---|
| 9 | 9 |
| 10 local t_insert, t_concat = table.insert, table.concat; | 10 local t_insert, t_concat = table.insert, table.concat; |
| 11 local s_match, s_gmatch = string.match, string.gmatch; | 11 local s_match, s_gmatch = string.match, string.gmatch; |
| 12 local tonumber, tostring, pairs = tonumber, tostring, pairs; | 12 local tonumber, tostring, pairs = tonumber, tostring, pairs; |
| 13 | 13 |
| 14 local urlencode = function (s) return s and (s:gsub("%W", function (c) return string.format("%%%x", c:byte()); end)); end | 14 local urlencode = function (s) return s and (s:gsub("%W", function (c) return string.format("%%%02x", c:byte()); end)); end |
| 15 | 15 |
| 16 local log = require "util.logger".init("httpserver"); | 16 local log = require "util.logger".init("httpserver"); |
| 17 | 17 |
| 18 local http_servers = {}; | 18 local http_servers = {}; |
| 19 | 19 |