aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2012-05-25 03:39:45 +0200
committerKim Alvefur <zash@zash.se>2012-05-25 03:39:45 +0200
commit1e99d3bcd00efc6895e34161d7329cebbdf13366 (patch)
treebe79e809578b33ea771a0c2dfb261b927f82730c /plugins
parent1d005781544a98e84893cf3defed1ff61c86e277 (diff)
downloadprosody-1e99d3bcd00efc6895e34161d7329cebbdf13366.tar.gz
prosody-1e99d3bcd00efc6895e34161d7329cebbdf13366.zip
mod_http: Fix normalize_path('/') to not return an empty string, fixes module:http_url()
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_http.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/mod_http.lua b/plugins/mod_http.lua
index edd4f59d..634fb188 100644
--- a/plugins/mod_http.lua
+++ b/plugins/mod_http.lua
@@ -17,8 +17,8 @@ local server = require "net.http.server";
server.set_default_host(module:get_option_string("http_default_host"));
local function normalize_path(path)
- if path:sub(1,1) ~= "/" then path = "/"..path; end
if path:sub(-1,-1) == "/" then path = path:sub(1, -2); end
+ if path:sub(1,1) ~= "/" then path = "/"..path; end
return path;
end