From 3550142f0bfe96a5ef90f07dafcdf6dec3000e21 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 13 Aug 2016 15:42:57 +0200 Subject: mod_register: Fix inverted throttle check (fixes #724) --- plugins/mod_register.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_register.lua b/plugins/mod_register.lua index fda717f7..df833cad 100644 --- a/plugins/mod_register.lua +++ b/plugins/mod_register.lua @@ -226,7 +226,7 @@ module:hook("stanza/iq/jabber:iq:register:query", function(event) session.send(st.error_reply(stanza, "cancel", "not-acceptable", "You are not allowed to register an account.")); return true; elseif min_seconds_between_registrations and not whitelisted_ips[session.ip] then - if check_throttle(session.ip) then + if not check_throttle(session.ip) then session.send(st.error_reply(stanza, "wait", "not-acceptable")); return true; end -- cgit v1.2.3 From 1686ef5d53d3d84d35ebebab89b8d1b22dcf021e Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 18 Aug 2016 14:51:11 +0200 Subject: mod_http: Allow configuring http parser size limits --- plugins/mod_http.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugins') diff --git a/plugins/mod_http.lua b/plugins/mod_http.lua index 9b574bc8..03b23480 100644 --- a/plugins/mod_http.lua +++ b/plugins/mod_http.lua @@ -18,6 +18,9 @@ local server = require "net.http.server"; server.set_default_host(module:get_option_string("http_default_host")); +server.set_option("body_size_limit", module:get_option_number("http_max_content_size")); +server.set_option("buffer_size_limit", module:get_option_number("http_max_buffer_size")); + local function normalize_path(path) if path:sub(-1,-1) == "/" then path = path:sub(1, -2); end if path:sub(1,1) ~= "/" then path = "/"..path; end -- cgit v1.2.3