From e3d135d3f1ee7a956228e642024e00e3da5cd807 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 26 Apr 2012 06:47:17 +0100 Subject: net.http.server: Lower score of wildcard handlers to ensure specific handlers beat them --- net/http/server.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/http/server.lua b/net/http/server.lua index 58554f39..906b3eaf 100644 --- a/net/http/server.lua +++ b/net/http/server.lua @@ -41,7 +41,7 @@ setmetatable(events._handlers, { if event == curr_event or is_wildcard_event(event) and is_wildcard_match(event, curr_event) then for handler, priority in pairs(handlers_set) do - matching_handlers_set[handler] = { (select(2, event:gsub("/", "%1"))), priority }; + matching_handlers_set[handler] = { (select(2, event:gsub("/", "%1"))), is_wildcard_event(event) and 0 or 1, priority }; table.insert(handlers_array, handler); end end -- cgit v1.2.3