diff options
author | Amber Brown <hawkowl@atleastfornow.net> | 2018-07-14 09:51:00 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-14 09:51:00 +1000 |
commit | 8a4f05fefbeff7ff984c0c81a66891edc455c85b (patch) | |
tree | f17724cdd5e3a4d144c2c30a0ab7b926b1f0287e | |
parent | Merge pull request #3534 from krombel/use_parse_and_asserts_from_servlet (diff) | |
download | synapse-8a4f05fefbeff7ff984c0c81a66891edc455c85b.tar.xz |
Fix develop because I broke it :( (#3535)
Diffstat (limited to '')
-rw-r--r-- | changelog.d/3535.misc | 0 | ||||
-rw-r--r-- | synapse/rest/client/v1/push_rule.py | 4 | ||||
-rw-r--r-- | synapse/streams/config.py | 3 |
3 files changed, 5 insertions, 2 deletions
diff --git a/changelog.d/3535.misc b/changelog.d/3535.misc new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/changelog.d/3535.misc diff --git a/synapse/rest/client/v1/push_rule.py b/synapse/rest/client/v1/push_rule.py index 7cf6a99774..6e95d9bec2 100644 --- a/synapse/rest/client/v1/push_rule.py +++ b/synapse/rest/client/v1/push_rule.py @@ -77,11 +77,11 @@ class PushRuleRestServlet(ClientV1RestServlet): before = parse_string(request, "before") if before: - before = _namespaced_rule_id(spec, before[0]) + before = _namespaced_rule_id(spec, before) after = parse_string(request, "after") if after: - after = _namespaced_rule_id(spec, after[0]) + after = _namespaced_rule_id(spec, after) try: yield self.store.add_push_rule( 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: |