aboutsummaryrefslogtreecommitdiffstats
path: root/net/httpserver.lua
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
commit3546ee5491d11577dd8e50051839385a30513933 (patch)
treefe648eee894d1dcc15c68724301a9c245bc1ad37 /net/httpserver.lua
parent1e5dc701c82e6c19c58cf337647ac8dd5136c443 (diff)
downloadprosody-3546ee5491d11577dd8e50051839385a30513933.tar.gz
prosody-3546ee5491d11577dd8e50051839385a30513933.zip
net.httpserver: Decode percent-encoded characters in URL path.
Diffstat (limited to 'net/httpserver.lua')
-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