From 56aab3892dae37af3f5a677bc43ccd27f12a4d4f Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 29 Nov 2021 16:34:30 +0000 Subject: [Fix] Fix stuctured headers pushing --- src/lua/lua_mimepart.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/lua/lua_mimepart.c') diff --git a/src/lua/lua_mimepart.c b/src/lua/lua_mimepart.c index c03ef35fd..db12cf672 100644 --- a/src/lua/lua_mimepart.c +++ b/src/lua/lua_mimepart.c @@ -1761,9 +1761,19 @@ lua_mimepart_get_headers (lua_State *L) lua_createtable (L, rspamd_mime_headers_count(part->raw_headers), 0); LL_FOREACH2(part->headers_order, cur, ord_next) { - rspamd_lua_push_header_array(L, cur->name, cur, RSPAMD_TASK_HEADER_PUSH_FULL, - need_modified); - lua_rawseti(L, -2, i++); + if (need_modified && cur->modified_chain) { + struct rspamd_mime_header *cur_modified; + + LL_FOREACH(cur->modified_chain, cur_modified) { + rspamd_lua_push_header(L, cur_modified, RSPAMD_TASK_HEADER_PUSH_FULL); + lua_rawseti(L, -2, i++); + } + } + else { + rspamd_lua_push_header(L, cur, RSPAMD_TASK_HEADER_PUSH_FULL); + lua_rawseti(L, -2, i++); + } + } } else { -- cgit v1.2.3