Software /
code /
prosody
Diff
net/http.lua @ 7523:3c40b972260e
Merge 0.10 -> trunk
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 27 Jul 2016 14:08:32 +0100 |
parent | 7465:f1923f00b7de |
parent | 7520:fc6c24cb3599 |
child | 7798:74cfec1fe5a2 |
line wrap: on
line diff
--- a/net/http.lua Sun Jul 24 17:36:53 2016 +0100 +++ b/net/http.lua Wed Jul 27 14:08:32 2016 +0100 @@ -117,7 +117,7 @@ local function handleerr(err) log("error", "Traceback[http]: %s", traceback(tostring(err), 2)); end local function log_if_failed(id, ret, ...) if not ret then - log("error", "Request %s: error in callback: %s", id, tostring((...))); + log("error", "Request '%s': error in callback: %s", id, tostring((...))); end return ...; end @@ -172,7 +172,7 @@ end end - log("debug", "Making %s %s request %s to %s", req.scheme, method or "GET", req.id, (ex and ex.suppress_url and host_header) or u); + log("debug", "Making %s %s request '%s' to %s", req.scheme:upper(), method or "GET", req.id, (ex and ex.suppress_url and host_header) or u); -- Attach to request object req.method, req.headers, req.body = method, headers, body; @@ -197,7 +197,7 @@ req.write = function (...) return req.handler:write(...); end req.callback = function (content, code, request, response) - log("debug", "request %s: Calling callback, status %s", req.id, code or "---"); + log("debug", "Request '%s': Calling callback, status %s", req.id, code or "---"); return log_if_failed(req.id, xpcall(function () return callback(content, code, request, response) end, handleerr)); end req.reader = request_reader;