diff options
Diffstat (limited to 'lualib/lua_selectors.lua')
-rw-r--r-- | lualib/lua_selectors.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lualib/lua_selectors.lua b/lualib/lua_selectors.lua index 4d0e7a2ec..78888de76 100644 --- a/lualib/lua_selectors.lua +++ b/lualib/lua_selectors.lua @@ -197,6 +197,18 @@ local selectors = { ['get_value'] = function(task, _, args) return task:get_mempool():get_variable(args[1], args[2]) end, + }, + -- Get specific HTTP request header. The first argument must be header name. + ['request_header'] = { + ['type'] = 'string', + ['get_value'] = function(task, _, args) + local hdr = task:get_request_header(args[1]) + if hdr then + return tostring(hdr) + end + + return nil + end } } |