stanza_router: Refactored core_handle_stanza, and added handling for unsupported...
[prosody.git] / net / httpserver.lua
index 0ecf84ea4e84bf5a24c010bced0c73e2400682b1..af23a91d95fb73113edfc40bbb41bfc99147e03a 100644 (file)
@@ -8,11 +8,10 @@ local connlisteners_get = require "net.connlisteners".get;
 local listener;
 
 local t_insert, t_concat = table.insert, table.concat;
-local s_match, s_gmatch, s_char = string.match, string.gmatch;
+local s_match, s_gmatch = string.match, string.gmatch;
 local tonumber, tostring, pairs = tonumber, tostring, pairs;
 
-local urlcodes = setmetatable({}, { __index = function (t, k) t[k] = s_char(tonumber("0x"..k)); return t[k]; end });
-local urlencode = function (s) return s and (s:gsub("%W", function (c) return string.format("%%%x", c:byte()); end)); end
+local urlencode = function (s) return s and (s:gsub("%W", function (c) return string.format("%%%02x", c:byte()); end)); end
 
 local log = require "util.logger".init("httpserver");