From 9d5830281a0a149e0fbfdda68e7c1ba760d20c7b Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 27 Apr 2012 18:37:40 +0100 Subject: mod_http: Routes now require a method to be specified, but the path has become optional (defaults to the base path with no trailing '/' --- plugins/mod_http.lua | 11 +++++------ 1 file 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 -- cgit v1.2.3