Skip to content

Commit

Permalink
updated check value and fixed customer certego.routing_history
Browse files Browse the repository at this point in the history
  • Loading branch information
giorgia-fusco8 committed Mar 12, 2024
1 parent eebb0eb commit 0bf89ea
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions routingfilter/filters/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,14 @@ def _check_value(self) -> Exception | NoReturn:
:return: none or error generated:
:rtype: Optional[Exception]
"""
tmp = []
for value in self._value:
try:
re.compile(value)
tmp.append(re.compile(value))
except re.error as e:
self.logger.error(f"Invalid regex {value}, during check of value list {self._value}. Error message: {e}")
raise ValueError(f"Regex check failed: error for value {value}. Error message: {e}")
self._value = tmp

def match(self, event: DictQuery) -> bool:
"""
Expand Down Expand Up @@ -293,7 +295,7 @@ def _check_regex(self, value: str) -> bool:
:rtype: bool
"""
for regex in self._value:
if re.search(regex, value):
if regex.search(value):
return True
return False

Expand Down

0 comments on commit 0bf89ea

Please sign in to comment.