fix(waf): handle empty rule bindings

Encode empty site bindings as arrays and normalize legacy JSON null values in the OpenResty runtime to prevent request-time Lua failures.
This commit is contained in:
ryan
2026-07-13 16:43:02 +08:00
parent 0c2961ae6d
commit 46941f65d5
9 changed files with 62 additions and 12 deletions
@@ -223,6 +223,8 @@ func TestBuildCurrentConfigBundleEnablesGlobalPoWWithoutExplicitBinding(t *testi
continue
}
foundWAFConfig = true
assert.Contains(t, file.Content, `"rule_group_ids":[]`)
assert.NotContains(t, file.Content, `"rule_group_ids":null`)
require.NoError(t, json.Unmarshal([]byte(file.Content), &wafRuntime))
}
require.True(t, foundWAFConfig, "expected rendered WAF support file")