Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Fix case-sensitivity.
Browse files Browse the repository at this point in the history
Note that the Rust code already handles lower-casing / uses
case-insensitive regular expressions.
  • Loading branch information
clokep committed Feb 3, 2023
1 parent 360a0d0 commit 40c8d4d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
4 changes: 1 addition & 3 deletions synapse/push/bulk_push_rule_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,7 @@ def _flatten_dict(
if result is None:
result = {}
for key, value in d.items():
if isinstance(value, str):
result[".".join(prefix + [key])] = value.lower()
elif isinstance(value, bool) or type(value) is int or value is None:
if isinstance(value, (bool, str)) or type(value) is int or value is None:
result[".".join(prefix + [key])] = value
elif isinstance(value, Mapping):
# do not set `room_version` due to recursion considerations below
Expand Down
11 changes: 5 additions & 6 deletions tests/push/test_push_rule_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,11 @@ def test_exact_event_match_string(self) -> None:
{"value": "foobaz"},
"exact value should match",
)
# TODO?
# self._assert_not_matches(
# condition,
# {"value": "FoobaZ"},
# "values should match and be case-sensitive",
# )
self._assert_not_matches(
condition,
{"value": "FoobaZ"},
"values should match and be case-sensitive",
)
self._assert_not_matches(
condition,
{"value": "test foobaz test"},
Expand Down

0 comments on commit 40c8d4d

Please sign in to comment.