# HG changeset patch # User Kim Alvefur # Date 1471723179 -7200 # Node ID f1923bf329a30330ab44fd8683a89904ad662103 # Parent 1266f5c17c0d0b7ddc1ec68301604f30fb871b98 mod_http_upload: Warn if upload size limit set higher than body size limit in http parser (applies to 0.10+) diff -r 1266f5c17c0d -r f1923bf329a3 mod_http_upload/mod_http_upload.lua --- a/mod_http_upload/mod_http_upload.lua Sat Aug 20 18:33:43 2016 +0200 +++ b/mod_http_upload/mod_http_upload.lua Sat Aug 20 21:59:39 2016 +0200 @@ -24,6 +24,13 @@ -- config local file_size_limit = module:get_option_number(module.name .. "_file_size_limit", 1024 * 1024); -- 1 MB +--- sanity +local parser_body_limit = module:context("*"):get_option_number("http_max_content_size", 10*1024*1024); +if file_size_limit > parser_body_limit then + module:log("warn", "%s_file_size_limit exceeds HTTP parser limit on body size, capping file size to %d B", module.name, parser_body_limit); + file_size_limit = parser_body_limit; +end + -- depends module:depends("http"); module:depends("disco");