aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-11-13 15:03:24 +0000
committerMatthew Wild <mwild1@gmail.com>2018-11-13 15:03:24 +0000
commita1c9bef6e89725377e98b86e60b945556fb3dd3d (patch)
tree5ee893654d1908ee8d705faae07b544a11284b9c /net
parente6423c7ed08ab3a2859f07deb599115a2c443dcb (diff)
downloadprosody-a1c9bef6e89725377e98b86e60b945556fb3dd3d.tar.gz
prosody-a1c9bef6e89725377e98b86e60b945556fb3dd3d.zip
net.http.server: Move event formation to avoid traceback on missing Host header
Diffstat (limited to 'net')
-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 7fbf6377..9b63d516 100644
--- a/net/http/server.lua
+++ b/net/http/server.lua
@@ -236,7 +236,6 @@ function handle_request(conn, request, finish_cb)
err_code, err = 400, "Missing or invalid 'Host' header";
end
end
- local host_event = request.method.." "..host..request.path:match("[^?]*");
if err then
response.status_code = err_code;
@@ -244,6 +243,7 @@ function handle_request(conn, request, finish_cb)
return;
end
+ local host_event = request.method.." "..host..request.path:match("[^?]*");
log("debug", "Firing event: %s", host_event);
result = events.fire_event(host_event, payload);
end