From dca5c82d2fa1b0ba2d4397501ec7f61d2bcc10e8 Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 9 Mar 2023 14:56:43 +0800 Subject: [PATCH] Update webstats_common.lua --- plugins/webstats/lua/webstats_common.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/webstats/lua/webstats_common.lua b/plugins/webstats/lua/webstats_common.lua index 7bfc8cbed..01110a371 100644 --- a/plugins/webstats/lua/webstats_common.lua +++ b/plugins/webstats/lua/webstats_common.lua @@ -210,18 +210,18 @@ function _M.get_http_origin(self) 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() - + -- proxy_pass, fastcgi_pass, uwsgi_pass, and scgi_pass data = ngx.var.request_body if not data then data = ngx.req.get_body_data() end - if not data then - data = ngx.req.get_post_args(1000000) - end + -- API disabled in the context of log_by_lua + -- if not data then + -- ngx.req.read_body() + -- data = ngx.req.get_post_args(1000000) + -- end if "string" == type(data) then headers["payload"] = data