Comparison

mod_http_upload/mod_http_upload.lua @ 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
parent 1905:43fac0c2c772
child 1912:24c22cbb86e4
comparison
equal deleted inserted replaced
1905:43fac0c2c772 1906:5849d70bcd37
112 end 112 end
113 113
114 local serve_uploaded_files = module:depends("http_files").serve(storage_path); 114 local serve_uploaded_files = module:depends("http_files").serve(storage_path);
115 local http_server = require"net.http.server"; 115 local http_server = require"net.http.server";
116 116
117 local function size_only(response, data) 117 local function size_only(response, body)
118 if data then 118 if body then
119 response.headers.content_size = #data; 119 response.headers.content_length = #body;
120 end 120 end
121 return http_server.send_response(response); 121 return http_server.send_response(response);
122 end 122 end
123 123
124 local function serve_head(event, path) 124 local function serve_head(event, path)