summary refs log tree commit diff
path: root/synapse/streams
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/streams')
-rw-r--r--synapse/streams/config.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/streams/config.py b/synapse/streams/config.py
index 22b0b830f7..451e4fa441 100644
--- a/synapse/streams/config.py
+++ b/synapse/streams/config.py
@@ -78,6 +78,9 @@ class PaginationConfig(object):
 
         limit = parse_integer(request, "limit", default=default_limit)
 
+        if limit and limit < 0:
+            raise SynapseError(400, "Limit must be 0 or above")
+
         try:
             return PaginationConfig(from_tok, to_tok, direction, limit)
         except Exception: