Mercurial > prosody-hg
diff net/http/server.lua @ 4704:d6c4e58333cf
net.http.server: Lower score of wildcard handlers to ensure specific handlers beat them
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Thu, 26 Apr 2012 06:47:17 +0100 |
| parents | f9a091b6dfd5 |
| children | 845393c76d17 |
line wrap: on
line diff
--- a/net/http/server.lua Thu Apr 26 06:42:02 2012 +0100 +++ b/net/http/server.lua Thu Apr 26 06:47:17 2012 +0100 @@ -41,7 +41,7 @@ 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
