Fix HOPS handling in nginx session
@@ -7,6 +7,7 @@ local redis = require "resty.redis"
--local HOPS = os.getenv("XFF_TRUSTED_HOPS") or 0
local redishost = os.getenv("REDIS_HOST") or "redis"
local redisport = os.getenv("REDIS_PORT") or 6379
+local HOPS = os.getenv("HOPS")
local function custom_response(handle, action_params)
if not action_params then action_params = {} end
@@ -90,7 +91,8 @@ function session_rust_nginx.inspect(handle, loglevel, secpolid, plugins)
-- * method : the HTTP verb
-- * authority : optionally, the HTTP2 authority field
local meta = { path=handle.var.request_uri, method=handle.req.get_method(), authority=nil }
- local params = {loglevel=loglevel, meta=meta, headers=headers, body=body_content, ip=handle.var.remote_addr, hops=HOPS, plugins=plugins}
+ local params = {loglevel=loglevel, meta=meta, headers=headers, body=body_content,
+ ip=handle.var.remote_addr, hops=HOPS, plugins=plugins}
if secpolid then
params['secpolid'] = secpolid
