summary refs log tree commit diff
path: root/synapse/streams/config.py
diff options
context:
space:
mode:
authorAmber Brown <hawkowl@atleastfornow.net>2018-07-14 09:51:00 +1000
committerGitHub <noreply@github.com>2018-07-14 09:51:00 +1000
commit8a4f05fefbeff7ff984c0c81a66891edc455c85b (patch)
treef17724cdd5e3a4d144c2c30a0ab7b926b1f0287e /synapse/streams/config.py
parentMerge pull request #3534 from krombel/use_parse_and_asserts_from_servlet (diff)
downloadsynapse-8a4f05fefbeff7ff984c0c81a66891edc455c85b.tar.xz
Fix develop because I broke it :( (#3535)
Diffstat (limited to 'synapse/streams/config.py')
-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: