# HG changeset patch # User tmolitor # Date 1502998496 -7200 # Node ID 1fa9620220e326e48bf3973608701900172ed7a8 # Parent 57d4680b86a4af8297e0ce991ac9998ce494deba# Parent 2e30bb3a10d5410337c196e1418b6602e37fd015 merge commit diff -r 2e30bb3a10d5 -r 1fa9620220e3 mod_http_upload/mod_http_upload.lua --- a/mod_http_upload/mod_http_upload.lua Thu Aug 17 21:32:52 2017 +0200 +++ b/mod_http_upload/mod_http_upload.lua Thu Aug 17 21:34:56 2017 +0200 @@ -256,8 +256,12 @@ local status_line = "HTTP/"..response.request.httpversion.." "..(response.status or codes[response.status_code]); local headers = response.headers; - body = body or response.body or ""; - headers.content_length = #body; + if type(body) == "string" then + headers.content_length = #body; + elseif io.type(body) == "file" then + headers.content_length = body:seek("end"); + body:close(); + end local output = { status_line }; for k,v in pairs(headers) do @@ -282,6 +286,7 @@ local function serve_head(event, path) event.response.send = send_response_sans_body; + event.response.send_file = send_response_sans_body; return serve_uploaded_files(event, path); end diff -r 2e30bb3a10d5 -r 1fa9620220e3 mod_register_web/mod_register_web.lua --- a/mod_register_web/mod_register_web.lua Thu Aug 17 21:32:52 2017 +0200 +++ b/mod_register_web/mod_register_web.lua Thu Aug 17 21:34:56 2017 +0200 @@ -1,6 +1,7 @@ local captcha_options = module:get_option("captcha_options", {}); local nodeprep = require "util.encodings".stringprep.nodeprep; local usermanager = require "core.usermanager"; +local datamanager = require "util.datamanager"; local http = require "net.http"; local path_sep = package.config:sub(1,1); local json = require "util.json".decode; @@ -39,12 +40,12 @@ function generate_captcha(display_options) return recaptcha_tpl.apply(setmetatable({ - recaptcha_display_error = display_options and display_options.recaptcha_error - and ("&error="..display_options.recaptcha_error) or ""; - }, { - __index = function (t, k) - if captcha_options[k] then return captcha_options[k]; end - module:log("error", "Missing parameter from captcha_options: %s", k); + recaptcha_display_error = display_options and display_options.recaptcha_error + and ("&error="..display_options.recaptcha_error) or ""; + }, { + __index = function (t, k) + if captcha_options[k] then return captcha_options[k]; end + module:log("error", "Missing parameter from captcha_options: %s", k); end })); end