mod_http: Fix normalize_path('/') to not return an empty string, fixes module:http_url()
--- a/plugins/mod_http.lua Fri May 25 02:32:33 2012 +0100
+++ b/plugins/mod_http.lua Fri May 25 03:39:45 2012 +0200
@@ -17,8 +17,8 @@
server.set_default_host(module:get_option_string("http_default_host"));
local function normalize_path(path)
+ if path:sub(-1,-1) == "/" then path = path:sub(1, -2); end
if path:sub(1,1) ~= "/" then path = "/"..path; end
- if path:sub(-1,-1) == "/" then path = path:sub(1, -2); end
return path;
end