diff options
author | Matthew Wild <mwild1@gmail.com> | 2012-04-27 18:37:40 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2012-04-27 18:37:40 +0100 |
commit | 9d5830281a0a149e0fbfdda68e7c1ba760d20c7b (patch) | |
tree | 87e0724ed8c274daec77d9fe1d630d1122451172 /plugins | |
parent | 5ecbd224981c62b5b1fe9526826de721f222a013 (diff) | |
download | prosody-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')
-rw-r--r-- | plugins/mod_http.lua | 11 |
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 |