aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
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
commitc06a35c238fc6e27e3b034a4cfe5c26f783692fb (patch)
tree87e0724ed8c274daec77d9fe1d630d1122451172 /plugins
parentd4e44895770446226c22513ac9bf1d7b12396f47 (diff)
downloadprosody-c06a35c238fc6e27e3b034a4cfe5c26f783692fb.tar.gz
prosody-c06a35c238fc6e27e3b034a4cfe5c26f783692fb.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')
-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