summary refs log tree commit diff
path: root/tests/api
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2023-05-22 11:31:22 -0400
committerGitHub <noreply@github.com>2023-05-22 11:31:22 -0400
commitc5d1e6d414fa7b4074bc72ca3719c1341a1c5379 (patch)
tree162a4c96efbb420bcfc3faa9b242b28868624580 /tests/api
parentBump pygithub from 1.58.1 to 1.58.2 (#15643) (diff)
downloadsynapse-c5d1e6d414fa7b4074bc72ca3719c1341a1c5379.tar.xz
Properly parse event_fields in filters (#15607)
The event_fields property in filters should use the proper
escape rules, namely backslashes can be escaped with
an additional backslash.

This adds tests (adapted from matrix-js-sdk) and implements
the logic to properly split the event_fields strings.
Diffstat (limited to 'tests/api')
-rw-r--r--tests/api/test_filtering.py6
1 files changed, 0 insertions, 6 deletions
diff --git a/tests/api/test_filtering.py b/tests/api/test_filtering.py
index 222449baac..aa6af5ad7b 100644
--- a/tests/api/test_filtering.py
+++ b/tests/api/test_filtering.py
@@ -48,8 +48,6 @@ class FilteringTestCase(unittest.HomeserverTestCase):
         invalid_filters: List[JsonDict] = [
             # `account_data` must be a dictionary
             {"account_data": "Hello World"},
-            # `event_fields` entries must not contain backslashes
-            {"event_fields": [r"\\foo"]},
             # `event_format` must be "client" or "federation"
             {"event_format": "other"},
             # `not_rooms` must contain valid room IDs
@@ -114,10 +112,6 @@ class FilteringTestCase(unittest.HomeserverTestCase):
                 "event_format": "client",
                 "event_fields": ["type", "content", "sender"],
             },
-            # a single backslash should be permitted (though it is debatable whether
-            # it should be permitted before anything other than `.`, and what that
-            # actually means)
-            #
             # (note that event_fields is implemented in
             # synapse.events.utils.serialize_event, and so whether this actually works
             # is tested elsewhere. We just want to check that it is allowed through the