From 0346a790226117b0c9e0b2ddf339300145f2bce4 Mon Sep 17 00:00:00 2001 From: potatso Date: Tue, 4 Jul 2023 13:00:25 +0800 Subject: [PATCH] =?UTF-8?q?reft:=20=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/resty/coraza.lua | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/resty/coraza.lua b/lib/resty/coraza.lua index 256df96..53c3844 100644 --- a/lib/resty/coraza.lua +++ b/lib/resty/coraza.lua @@ -124,19 +124,13 @@ function _M.do_header_filter() -- copy from https://github.com/SpiderLabs/ModSecurity-nginx/blob/d59e4ad121df702751940fd66bcc0b3ecb51a079/src/ngx_http_modsecurity_header_filter.c#L527 coraza.process_response_headers(ngx_ctx.transaction, ngx.status, "HTTP 1.1") - -- TODO: add http response body to coraza.append_response_body. Openresty can't disrupt the body_filter phrase - --local resp_body = string.sub(ngx.arg[1], 1, 1000) - --ngx.ctx.buffered = (ngx.ctx.buffered or "") .. resp_body - --if ngx.arg[2] then - -- ngx.var.resp_body = ngx.ctx.buffered - --end - -- - --coraza.append_response_body(ngx_ctx.transaction, ngx.ctx.buffered) - --coraza.process_response_body(ngx_ctx.transaction) - ngx_ctx.action, ngx_ctx.status_code = coraza.intervention(ngx_ctx.transaction) end +function _M.do_body_filter() + -- TODO +end + function _M.do_log() local msg = coraza.get_matched_logmsg(ngx_ctx.transaction) ngx_ctx.coraza_msg = msg