From 2c3ad7ea99ca8205c2eb9ea808e2bc9538a8f9c8 Mon Sep 17 00:00:00 2001 From: midoks Date: Mon, 23 Jan 2023 20:30:01 +0800 Subject: [PATCH] Update webstats_common.lua --- plugins/webstats/lua/webstats_common.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/webstats/lua/webstats_common.lua b/plugins/webstats/lua/webstats_common.lua index b1ab6cfd6..6ccd8dff1 100644 --- a/plugins/webstats/lua/webstats_common.lua +++ b/plugins/webstats/lua/webstats_common.lua @@ -200,10 +200,10 @@ end function _M.get_http_origin(self) local data = "" - local method = ngx.req.get_method() - if not headers then return data end local headers = ngx.req.get_headers() - if method ~='GET' then + if not headers then return data end + local req_method = ngx.req.get_method() + if req_method ~='GET' then -- API disabled in the context of log_by_lua* -- ngx.req.read_body()