diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2022-10-14 08:30:05 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-14 12:30:05 +0000 |
commit | 126a15794c95002560709283640ad412636b29b8 (patch) | |
tree | dca3e2380f4bec49b5dcff4407bc6405eef05692 /synapse/rest/client/events.py | |
parent | Set LD_PRELOAD to load jemalloc in Dockerfile-workers. (#14182) (diff) | |
download | synapse-126a15794c95002560709283640ad412636b29b8.tar.xz |
Do not allow a None-limit on PaginationConfig. (#14146)
The callers either set a default limit or manually handle a None-limit later on (by setting a default value). Update the callers to always instantiate PaginationConfig with a default limit and then assume the limit is non-None.
Diffstat (limited to 'synapse/rest/client/events.py')
-rw-r--r-- | synapse/rest/client/events.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/rest/client/events.py b/synapse/rest/client/events.py index 916f5230f1..782e7d14e8 100644 --- a/synapse/rest/client/events.py +++ b/synapse/rest/client/events.py @@ -50,7 +50,9 @@ class EventStreamRestServlet(RestServlet): raise SynapseError(400, "Guest users must specify room_id param") room_id = parse_string(request, "room_id") - pagin_config = await PaginationConfig.from_request(self.store, request) + pagin_config = await PaginationConfig.from_request( + self.store, request, default_limit=10 + ) timeout = EventStreamRestServlet.DEFAULT_LONGPOLL_TIME_MS if b"timeout" in args: try: |