aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_task.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-10-15 10:12:34 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-10-15 10:12:34 +0100
commitecc5f7d5dba938efd4ae09278e942135f40c9aa6 (patch)
tree8f83a81126c7bce8528ca1d5dfceed765ae2aec7 /src/lua/lua_task.c
parent57bf1e47ddbda63545fdf33a312062d7f41c812e (diff)
downloadrspamd-ecc5f7d5dba938efd4ae09278e942135f40c9aa6.tar.gz
rspamd-ecc5f7d5dba938efd4ae09278e942135f40c9aa6.zip
[Minor] Add method to get headers from mime parts
Diffstat (limited to 'src/lua/lua_task.c')
-rw-r--r--src/lua/lua_task.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index 29d253217..7f9eb0343 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -3126,14 +3126,15 @@ lua_task_get_headers (lua_State *L)
{
LUA_TRACE_POINT;
struct rspamd_task *task = lua_check_task (L, 1);
+ bool need_modified = lua_isnoneornil(L, 2) ? false : lua_toboolean(L, 2);
if (task && task->message) {
struct rspamd_mime_header *cur;
lua_createtable (L, rspamd_mime_headers_count(MESSAGE_FIELD(task, raw_headers)), 0);
- DL_FOREACH(MESSAGE_FIELD(task, headers_order), cur) {
+ LL_FOREACH2(MESSAGE_FIELD(task, headers_order), cur, ord_next) {
rspamd_lua_push_header_array(L, cur->name, cur, RSPAMD_TASK_HEADER_PUSH_FULL,
- false);
+ need_modified);
}
}
else {