# HG changeset patch # User Matthew Wild # Date 1335548260 -3600 # Node ID 1c6c4c53f08a4037bcb868ad4235f4024abf279a # Parent fddc2797a96aef80ffbb1d7433690ad1fdec18ce mod_http: Routes now require a method to be specified, but the path has become optional (defaults to the base path with no trailing '/' diff -r fddc2797a96a -r 1c6c4c53f08a plugins/mod_http.lua --- a/plugins/mod_http.lua Fri Apr 27 18:36:27 2012 +0100 +++ b/plugins/mod_http.lua Fri Apr 27 18:37:40 2012 +0100 @@ -18,13 +18,12 @@ 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 - path = normalize_path(path); + if method:sub(1,1) == "/" then + return nil; + end return method:upper().." "..host..app_path..path; end