aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_http.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-04-27 18:37:40 +0100
committerMatthew Wild <mwild1@gmail.com>2012-04-27 18:37:40 +0100
commit9d5830281a0a149e0fbfdda68e7c1ba760d20c7b (patch)
tree87e0724ed8c274daec77d9fe1d630d1122451172 /plugins/mod_http.lua
parent5ecbd224981c62b5b1fe9526826de721f222a013 (diff)
downloadprosody-9d5830281a0a149e0fbfdda68e7c1ba760d20c7b.tar.gz
prosody-9d5830281a0a149e0fbfdda68e7c1ba760d20c7b.zip
mod_http: Routes now require a method to be specified, but the path has become optional (defaults to the base path with no trailing '/'
Diffstat (limited to 'plugins/mod_http.lua')
-rw-r--r--plugins/mod_http.lua11
1 files changed, 5 insertions, 6 deletions
diff --git a/plugins/mod_http.lua b/plugins/mod_http.lua
index 93d58439..4c6c1299 100644
--- a/plugins/mod_http.lua
+++ b/plugins/mod_http.lua
@@ -18,13 +18,12 @@ end
local function get_http_event(host, app_path, key)
local method, path = key:match("^(%S+)%s+(.+)$");
- if not method then
- if key:sub(1,1) ~= "/" then
- return nil;
- end
- method, path = "GET", key;
+ if not method then -- No path specified, default to "" (base path)
+ method, path = key, "";
+ end
+ if method:sub(1,1) == "/" then
+ return nil;
end
- path = normalize_path(path);
return method:upper().." "..host..app_path..path;
end