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