aboutsummaryrefslogtreecommitdiffstats
path: root/net/http/server.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-04-26 06:47:17 +0100
committerMatthew Wild <mwild1@gmail.com>2012-04-26 06:47:17 +0100
commite3d135d3f1ee7a956228e642024e00e3da5cd807 (patch)
tree3d37a91f9a7037641edf2d40247afb2586bb31de /net/http/server.lua
parent9b7e2f6d4b643bf24fb2adac75d2129dfb68bcd0 (diff)
downloadprosody-e3d135d3f1ee7a956228e642024e00e3da5cd807.tar.gz
prosody-e3d135d3f1ee7a956228e642024e00e3da5cd807.zip
net.http.server: Lower score of wildcard handlers to ensure specific handlers beat them
Diffstat (limited to 'net/http/server.lua')
-rw-r--r--net/http/server.lua2
1 files changed, 1 insertions, 1 deletions
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