Changeset

4069:a90bbca91c87

net.httpserver: Decode percent-encoded characters in URL path.
author Waqas Hussain <waqas20@gmail.com>
date Wed, 05 Jan 2011 06:23:17 +0500
parents 4068:15c4cefb825c
children 4070:c11f1cc2c79d
files net/httpserver.lua
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/net/httpserver.lua	Wed Jan 05 06:16:27 2011 +0500
+++ b/net/httpserver.lua	Wed Jan 05 06:23:17 2011 +0500
@@ -119,6 +119,7 @@
 		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