aboutsummaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-10-12 19:30:29 +0200
committerKim Alvefur <zash@zash.se>2019-10-12 19:30:29 +0200
commit30a72c72a392fdbee1e91946c9a72ed88a20b232 (patch)
tree1968f0896b4b58351e9010f37d031a23ddbe0c72 /net/http
parentbf5f096225ec159e50e38b6631114553a03adce9 (diff)
downloadprosody-30a72c72a392fdbee1e91946c9a72ed88a20b232.tar.gz
prosody-30a72c72a392fdbee1e91946c9a72ed88a20b232.zip
net.http.server: Explicitly convert number to string, avoiding implicit coercion
Diffstat (limited to 'net/http')
-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 b649ff5f..bf24c97e 100644
--- a/net/http/server.lua
+++ b/net/http/server.lua
@@ -314,7 +314,7 @@ end
function _M.send_response(response, body)
if response.finished then return; end
body = body or response.body or "";
- response.headers.content_length = #body;
+ response.headers.content_length = ("%d"):format(#body);
if response.is_head_request then
return _M.send_head_response(response)
end