aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libmime/mime_headers.c2
-rw-r--r--src/lua/lua_task.c9
-rw-r--r--test/lua/unit/selectors.lua2
3 files changed, 11 insertions, 2 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;
diff --git a/test/lua/unit/selectors.lua b/test/lua/unit/selectors.lua
index be77454e5..a9506fa31 100644
--- a/test/lua/unit/selectors.lua
+++ b/test/lua/unit/selectors.lua
@@ -62,7 +62,7 @@ context("Selectors test", function()
["digest"] = {
selector = "digest",
- expect = {"c459a21bd1f33fb4ba035481f46ef0c7"}
+ expect = {"5b756ff185494c36f26c17a70b042f21"}
},
["user"] = {