changeset 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 b80f7848d8a2
children 22832c1d2827
files src/backend.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/backend.py	Sun Jan 06 17:30:04 2019 +0100
+++ b/src/backend.py	Thu Jan 10 08:42:49 2019 +0100
@@ -1659,6 +1659,8 @@
     def items(self, request):
         ext_data = {}
         if const.FLAG_ENABLE_RSM and request.rsm is not None:
+            if request.rsm.max < 0:
+                raise pubsub.BadRequest(text="max can't be negative")
             ext_data['rsm'] = request.rsm
         try:
             ext_data['pep'] = request.delegated