Changeset

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
parents 10326:cd1c73c2bdec
children 10328:5c2b31c823b9
files net/http/files.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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