Validate uniqueness of http filter names

This commit is contained in:
Michael Lumish 2021-07-20 14:12:59 -07:00
parent ae2cb672b2
commit f03b4dd87f
1 changed files with 6 additions and 1 deletions

View File

@ -141,7 +141,12 @@ export class RdsState implements XdsStreamState<RouteConfiguration__Output> {
return false;
}
if (EXPERIMENTAL_FAULT_INJECTION) {
for (const filterConfig of Object.values(route.typed_per_filter_config ?? {})) {
const filterNames = new Set<string>();
for (const [name, filterConfig] of Object.entries(route.typed_per_filter_config ?? {})) {
if (filterNames.has(name)) {
return false;
}
filterNames.add(name);
if (!validateOverrideFilter(filterConfig)) {
return false;
}