Software /
code /
prosody
Changeset
7463:3b6e7ce9431f
net.http: Add request.id to every request object (can be overridden by providing ex.id)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 07 Jul 2016 23:07:19 +0100 |
parents | 7461:72e48bddf617 |
children | 7464:3b7de72e58a9 |
files | net/http.lua |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/net/http.lua Tue Jun 28 14:49:44 2016 +0100 +++ b/net/http.lua Thu Jul 07 23:07:19 2016 +0100 @@ -27,6 +27,8 @@ local requests = {}; -- Open requests +local function make_id(req) return (tostring(req):match("%x+$")); end + local listener = { default_port = 80, default_mode = "*a" }; function listener.onconnect(conn) @@ -125,6 +127,8 @@ req.path = "/"; end + req.id = ex and ex.id or make_id(req); + local method, headers, body; local host, port = req.host, req.port;