uuWAF icon indicating copy to clipboard operation
uuWAF copied to clipboard

使用插件设置响应头只有部分url生效

Open jinxinkai opened this issue 1 year ago • 4 comments

local _M = {
    version = 0.1,          --  插件版本
    name = "set_user"   --  插件名称
}

-- 返回header阶段过滤函数
function _M.resp_header_filter(waf)
    ngx.header["X-User"] = "test"
end

return _M

image image

jinxinkai avatar Apr 11 '24 13:04 jinxinkai

目前只对返回类型为 text/html、text/plain、xml、json的内容启用插件功能,我们也看用户需求是否要全部类型都启用自定义插件功能

Safe3 avatar Apr 11 '24 15:04 Safe3

希望能对所有type启用,特别是video类、js类

jinxinkai avatar Apr 11 '24 16:04 jinxinkai

好的,下一版本我们将每个阶段拆分成pre和post前后两个阶段,方便你这种在pre阶段处理

Safe3 avatar Apr 12 '24 00:04 Safe3

最新的v4.0.1版已支持该功能,如下插件可满足你的需求 local _M = { version = 0.1, -- 插件版本 name = "set_user" -- 插件名称 }

function _M.resp_header_pre_filter(waf) ngx.header["X-User"] = "test" end

return _M

Safe3 avatar Apr 16 '24 11:04 Safe3