From: Vsevolod Stakhov Date: Thu, 31 May 2018 16:23:39 +0000 (+0100) Subject: [Feature] Add gzip compression for HTTP requests in elastic module X-Git-Tag: 1.7.6~71 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b45bc487b77ad51e3cf25ad9f0b19334c821cc6f;p=rspamd.git [Feature] Add gzip compression for HTTP requests in elastic module --- diff --git a/src/plugins/lua/elastic.lua b/src/plugins/lua/elastic.lua index 4caedd684..3a80256d2 100644 --- a/src/plugins/lua/elastic.lua +++ b/src/plugins/lua/elastic.lua @@ -46,6 +46,7 @@ local settings = { failover = false, import_kibana = false, use_https = false, + use_gzip = true, allow_local = false, } @@ -106,6 +107,7 @@ local function elastic_send_data(task) body = bulk_json, task = task, method = 'post', + gzip = settings.use_gzip, callback = http_index_data_callback }) @@ -305,6 +307,7 @@ local function initial_setup(cfg, ev_base, worker) }, body = table.concat(tbl, "\n"), method = 'post', + gzip = settings.use_gzip, callback = kibana_template_callback }) else @@ -341,6 +344,7 @@ local function initial_setup(cfg, ev_base, worker) headers = { ['Content-Type'] = 'application/json', }, + gzip = settings.use_gzip, body = ucl.to_format(template, 'json-compact'), method = 'put', }) @@ -366,6 +370,7 @@ local function initial_setup(cfg, ev_base, worker) headers = { ['Content-Type'] = 'application/json', }, + gzip = settings.use_gzip, callback = http_template_put_callback, }) else