net.http.files: Explicitly convert number to string, avoiding implicit coercion
authorKim Alvefur <zash@zash.se>
Sat, 12 Oct 2019 19:31:48 +0200
changeset 10331 34f7a0e8fa59
parent 10330 cd1c73c2bdec
child 10332 5c2b31c823b9
net.http.files: Explicitly convert number to string, avoiding implicit coercion
net/http/files.lua
--- 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