diff options
Diffstat (limited to 'plugins/mod_http.lua')
-rw-r--r-- | plugins/mod_http.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/mod_http.lua b/plugins/mod_http.lua index 28d5d2d4..bd94de40 100644 --- a/plugins/mod_http.lua +++ b/plugins/mod_http.lua @@ -172,7 +172,13 @@ module:wrap_object_event(server._events, false, function (handlers, event_name, -- Not included in eg http-error events request.ip = get_ip_from_request(request); end - return handlers(event_name, event_data); + local ret = handlers(event_name, event_data); + if ret ~= nil then + return ret; + end + local host = (request.headers.host or ""):match("[^:]+"); + local host_event = request.method.." "..host..request.path:match("[^?]*"); + return handlers(host_event, event_data); end); module:provides("net", { |