aboutsummaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
Diffstat (limited to 'net/http')
-rw-r--r--net/http/server.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/net/http/server.lua b/net/http/server.lua
index 877c7f17..5b42208c 100644
--- a/net/http/server.lua
+++ b/net/http/server.lua
@@ -233,10 +233,15 @@ function handle_request(conn, request, finish_cb)
return;
end
- local event = request.method.." "..host..request.path:match("[^?]*");
+ local global_event = request.method.." "..request.path:match("[^?]*");
+ local host_event = request.method.." "..host..request.path:match("[^?]*");
local payload = { request = request, response = response };
- log("debug", "Firing event: %s", event);
- local result = events.fire_event(event, payload);
+ log("debug", "Firing event: %s", global_event);
+ local result = events.fire_event(global_event, payload);
+ if result == nil then
+ log("debug", "Firing event: %s", host_event);
+ result = events.fire_event(host_event, payload);
+ end
if result ~= nil then
if result ~= true then
local body;