diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-07-12 15:54:59 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-07-12 15:54:59 +0100 |
commit | b8c6149a7678a5593daa5ffe96a2d22953c341b1 (patch) | |
tree | 280a9c9c160478a03dc84561c66af024586e80be /src | |
parent | 9a8b57376c793110196188b814ba34184902f5dc (diff) | |
download | rspamd-b8c6149a7678a5593daa5ffe96a2d22953c341b1.tar.gz rspamd-b8c6149a7678a5593daa5ffe96a2d22953c341b1.zip |
[Minor] Fix some cases of strong headers usage
Diffstat (limited to 'src')
-rw-r--r-- | src/libmime/mime_headers.c | 2 | ||||
-rw-r--r-- | src/lua/lua_task.c | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/libmime/mime_headers.c b/src/libmime/mime_headers.c index f9027b53d..99936dd8c 100644 --- a/src/libmime/mime_headers.c +++ b/src/libmime/mime_headers.c @@ -161,6 +161,8 @@ rspamd_mime_header_add (struct rspamd_task *task, } else { kh_value (target, k) = rh; + rh->prev = rh; + rh->next = NULL; msg_debug_task ("add new raw header %s: %s", rh->name, rh->value); } diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index afe83c1a5..1a4c8dc34 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -2450,7 +2450,14 @@ rspamd_lua_push_header_array (lua_State *L, lua_pushinteger (L, i); } else { - return rspamd_lua_push_header (L, rh, how); + DL_FOREACH (rh, cur) { + if (!strong || strcmp (name, cur->name) == 0) { + return rspamd_lua_push_header (L, cur, how); + } + } + + /* Not found with this case */ + lua_pushnil (L); } return 1; |