Software /
code /
prosody
Diff
net/http/files.lua @ 10327:34f7a0e8fa59
net.http.files: Explicitly convert number to string, avoiding implicit coercion
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 12 Oct 2019 19:31:48 +0200 |
parent | 10065:b399dca1273c |
child | 10411:db2a06b9ff98 |
line wrap: on
line diff
--- a/net/http/files.lua Sat Oct 12 19:30:29 2019 +0200 +++ b/net/http/files.lua Sat Oct 12 19:31:48 2019 +0200 @@ -127,7 +127,7 @@ local content_type = ext and mime_map[ext]; response_headers.content_type = content_type; if attr.size > cache_max_file_size then - response_headers.content_length = attr.size; + response_headers.content_length = ("%d"):format(attr.size); log("debug", "%d > cache_max_file_size", attr.size); return response:send_file(f); else