Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update chaitin-waf.lua to support unix sock in host pattern #10161

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apisix/plugins/chaitin-waf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ local metadata_schema = {
properties = {
host = {
type = "string",
pattern = "^\\*?[0-9a-zA-Z-._\\[\\]:]+$"
pattern = "^\\*?[0-9a-zA-Z-._\\[\\]:/]+$"
},
port = {
type = "integer",
Expand Down
5 changes: 5 additions & 0 deletions t/plugin/chaitin-waf.t
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ add_block_preprocessor(sub {
server {
listen 8088;
listen 8089;
listen unix:/tmp/safeline-snserver.sock;
content_by_lua_block {
require("lib.chaitin_waf_server").pass()
}
Expand Down Expand Up @@ -136,6 +137,10 @@ __DATA__
{
"host": "127.0.0.1",
"port": 8089
},
{
"host": "unix:/tmp/safeline-snserver.sock",
"port": 8000
}
]
}]]
Expand Down