changeset 1906:5849d70bcd37

mod_http_upload: Fix Content-Length header (it is now identical to the one in net.http.server)
author Kim Alvefur <zash@zash.se>
date Wed, 14 Oct 2015 13:20:59 +0200
parents 43fac0c2c772
children 7fe7bd7b33b6
files mod_http_upload/mod_http_upload.lua
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mod_http_upload/mod_http_upload.lua	Tue Oct 13 20:21:11 2015 +0200
+++ b/mod_http_upload/mod_http_upload.lua	Wed Oct 14 13:20:59 2015 +0200
@@ -114,9 +114,9 @@
 local serve_uploaded_files = module:depends("http_files").serve(storage_path);
 local http_server = require"net.http.server";
 
-local function size_only(response, data)
-	if data then
-		response.headers.content_size = #data;
+local function size_only(response, body)
+	if body then
+		response.headers.content_length = #body;
 	end
 	return http_server.send_response(response);
 end