diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-11-19 12:28:24 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-11-19 12:28:24 +0000 |
commit | eb0c31d1ad5d662ce5b19751961ea5952e0ae471 (patch) | |
tree | d5e43d1b58daaa40c281187476aecbdfed49949e /src/lua | |
parent | eb976e4166e51854f056fd84be68b77d6c616fcd (diff) | |
download | rspamd-eb0c31d1ad5d662ce5b19751961ea5952e0ae471.tar.gz rspamd-eb0c31d1ad5d662ce5b19751961ea5952e0ae471.zip |
Return nil if header was not found in lua_task.
Diffstat (limited to 'src/lua')
-rw-r--r-- | src/lua/lua_task.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index f6df133a6..dc123795f 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -190,7 +190,7 @@ LUA_FUNCTION_DEF (task, get_parts); */ LUA_FUNCTION_DEF (task, get_header); /*** - * @method task:get_raw_header(name[, case_sensitive]) + * @method task:get_header_raw(name[, case_sensitive]) * Get raw value of a header specified with optional case_sensitive flag. * By default headers are searched in caseless matter. * @param {string} name name of header to get @@ -934,15 +934,17 @@ lua_task_push_header (lua_State * L, gint i = 1; const gchar *val; - if (full) { - lua_newtable (L); - } rh = g_hash_table_lookup (task->raw_headers, name); if (rh == NULL) { + lua_pushnil (L); return 1; } + if (full) { + lua_newtable (L); + } + while (rh) { if (rh->name == NULL) { rh = rh->next; |