diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-11-19 13:15:57 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-11-19 13:15:57 +0000 |
commit | 09392cbc4bb9e6318f586bc90129c9a5529f7085 (patch) | |
tree | eabf4b24d2d7d4e0c3f85a78b83a797598ec0220 /lualib/lua_maps.lua | |
parent | 0426d0a55f6cef83d98a67432807d6687d55d17e (diff) | |
download | rspamd-09392cbc4bb9e6318f586bc90129c9a5529f7085.tar.gz rspamd-09392cbc4bb9e6318f586bc90129c9a5529f7085.zip |
[Minor] Add content type
Diffstat (limited to 'lualib/lua_maps.lua')
-rw-r--r-- | lualib/lua_maps.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lualib/lua_maps.lua b/lualib/lua_maps.lua index 21480ad63..6ce3f64eb 100644 --- a/lualib/lua_maps.lua +++ b/lualib/lua_maps.lua @@ -118,6 +118,7 @@ local function query_external_map(map_config, upstreams, key, callback, task) if type(key) == 'string' or type(key) == 'userdata' then if map_config.method == 'body' then http_body = key + http_headers['Content-Type'] = 'text/plain' elseif map_config.method == 'header' then http_headers = { key = key @@ -129,8 +130,10 @@ local function query_external_map(map_config, upstreams, key, callback, task) if map_config.method == 'body' then if map_config.encode == 'json' then http_body = ucl.to_format(key, 'json-compact', true) + http_headers['Content-Type'] = 'application/json' elseif map_config.encode == 'messagepack' then http_body = ucl.to_format(key, 'messagepack', true) + http_headers['Content-Type'] = 'application/msgpack' else local caller = debug.getinfo(2) or {} rspamd_logger.errx(task, |