Mercurial > libervia-pubsub
comparison src/backend.py @ 377:ded7657b03fa
backend: send a BadRequest if RSM max is negative
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 10 Jan 2019 08:42:49 +0100 |
parents | 9a787881b824 |
children | e81964db3cd6 |
comparison
equal
deleted
inserted
replaced
376:b80f7848d8a2 | 377:ded7657b03fa |
---|---|
1657 return d.addErrback(self._mapErrors) | 1657 return d.addErrback(self._mapErrors) |
1658 | 1658 |
1659 def items(self, request): | 1659 def items(self, request): |
1660 ext_data = {} | 1660 ext_data = {} |
1661 if const.FLAG_ENABLE_RSM and request.rsm is not None: | 1661 if const.FLAG_ENABLE_RSM and request.rsm is not None: |
1662 if request.rsm.max < 0: | |
1663 raise pubsub.BadRequest(text="max can't be negative") | |
1662 ext_data['rsm'] = request.rsm | 1664 ext_data['rsm'] = request.rsm |
1663 try: | 1665 try: |
1664 ext_data['pep'] = request.delegated | 1666 ext_data['pep'] = request.delegated |
1665 except AttributeError: | 1667 except AttributeError: |
1666 pass | 1668 pass |