# HG changeset patch # User Kim Alvefur # Date 1537566017 -7200 # Node ID 816591db764d7bfbf8a8fa58adef502cdc3ac162 # Parent a1a39d3952604878920a3e9cb4533402562ebaf5 net.http.server: Fire an event without host diff -r a1a39d395260 -r 816591db764d net/http/server.lua --- a/net/http/server.lua Sun Sep 23 17:12:21 2018 +0100 +++ b/net/http/server.lua Fri Sep 21 23:40:17 2018 +0200 @@ -233,10 +233,15 @@ 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;