aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-04-28 19:36:09 +0100
committerMatthew Wild <mwild1@gmail.com>2012-04-28 19:36:09 +0100
commitcd8b026b999a7b7abc77f557302ac751982f6d6d (patch)
tree5692323febe6e4198ede28e5e501eaeddf162b38
parent6521b0e6612036ceb4d4db1a8e6a99ac3d3a4ec2 (diff)
downloadprosody-cd8b026b999a7b7abc77f557302ac751982f6d6d.tar.gz
prosody-cd8b026b999a7b7abc77f557302ac751982f6d6d.zip
net.http.server: Use response.body if it exists and body is not specified to send_response
-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 295592d3..e15e6e14 100644
--- a/net/http/server.lua
+++ b/net/http/server.lua
@@ -228,7 +228,7 @@ function _M.send_response(response, body)
local status_line = "HTTP/"..response.request.httpversion.." "..(response.status or codes[response.status_code]);
local headers = response.headers;
- body = body or "";
+ body = body or response.body or "";
headers.content_length = #body;
local output = { status_line };