fix: refactor host matching logic in TestGenerateConfig_WithWAFPerHostDisabled for clarity

This commit is contained in:
GitHub Actions
2026-01-01 03:09:25 +00:00
parent d7fb784fa4
commit 5ed998a9c4

View File

@@ -990,9 +990,10 @@ func TestGenerateConfig_WithWAFPerHostDisabled(t *testing.T) {
var wafEnabledRoute, wafDisabledRoute *Route
for _, route := range server.Routes {
if len(route.Match) > 0 && len(route.Match[0].Host) > 0 {
if route.Match[0].Host[0] == "waf-enabled.example.com" {
switch route.Match[0].Host[0] {
case "waf-enabled.example.com":
wafEnabledRoute = route
} else if route.Match[0].Host[0] == "waf-disabled.example.com" {
case "waf-disabled.example.com":
wafDisabledRoute = route
}
}