From d3d9a986ba588bba4f28b856f19f2a75209d3763 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Tue, 16 Dec 2008 03:46:17 +0500 Subject: Fixed URL encoding to generate %0x instead of %x --- net/http.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net') diff --git a/net/http.lua b/net/http.lua index e8a981b8..a661bb52 100644 --- a/net/http.lua +++ b/net/http.lua @@ -13,7 +13,7 @@ local tonumber, tostring, pairs = tonumber, tostring, pairs; local print = function () end local urlcodes = setmetatable({}, { __index = function (t, k) t[k] = 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 module "http" -- cgit v1.2.3