aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2011-01-05 06:23:17 +0500
committerWaqas Hussain <waqas20@gmail.com>2011-01-05 06:23:17 +0500
commited8184a2c57bb5933a21730208aa13c2c60cfd07 (patch)
tree6da236e38f2ff326f3b47aad1ee7d14affafe304
parent62638e4fcd3d173fc95d60785b0b6b5283e2fb0f (diff)
downloadprosody-ed8184a2c57bb5933a21730208aa13c2c60cfd07.tar.gz
prosody-ed8184a2c57bb5933a21730208aa13c2c60cfd07.zip
net.httpserver: Decode percent-encoded characters in URL path.
-rw-r--r--net/httpserver.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/httpserver.lua b/net/httpserver.lua
index 4c1200ac..4be62ced 100644
--- a/net/httpserver.lua
+++ b/net/httpserver.lua
@@ -119,6 +119,7 @@ local function request_reader(request, data, startpos)
local function success_cb(r)
for k,v in pairs(r) do request[k] = v; end
request.url = url_parse(request.path);
+ request.url.path = request.url.path and request.url.path:gsub("%%(%x%x)", function(x) return x.char(tonumber(x, 16)) end);
request.body = { request.body };
call_callback(request);
end