From 4cbceab7cee7935e9a8bb6a87007c0f35116cf87 Mon Sep 17 00:00:00 2001 From: Philipp Kilian Date: Wed, 29 May 2024 11:25:48 +0200 Subject: [PATCH] api: update out of range check for meeting name and meeting id --- CHANGELOG.md | 2 +- b3lb/rest/classes/api.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b204d4a..f0fd5a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ Fixes: - add possibility to use the same meeting ID for two different secrets. -- send an error if meeting id is too long (2 < id_length < 100 chars) +- return an error message if meeting id is out of range (2 <= id_length <= 100 chars) ## 3.2.2 - 2024-05-23 diff --git a/b3lb/rest/classes/api.py b/b3lb/rest/classes/api.py index a495e13..9f01705 100644 --- a/b3lb/rest/classes/api.py +++ b/b3lb/rest/classes/api.py @@ -116,10 +116,10 @@ async def create(self) -> HttpResponse: if not self.meeting_id: return HttpResponse(cst.RETURN_STRING_MISSING_MEETING_ID, content_type=cst.CONTENT_TYPE) - if not 2 <= len(self.meeting_id) < cst.MEETING_ID_LENGTH: + if not 2 <= len(self.meeting_id) <= cst.MEETING_ID_LENGTH: return HttpResponse(cst.RETURN_STRING_MISSING_MEETING_ID_TO_LONG, content_type=cst.CONTENT_TYPE) - if not 2 <= len(self.meeting_name) < cst.MEETING_NAME_LENGTH: + if not 2 <= len(self.meeting_name) <= cst.MEETING_NAME_LENGTH: return HttpResponse(cst.RETURN_STRING_WRONG_MEETING_NAME_LENGTH, content_type=cst.CONTENT_TYPE) if not await self.is_meeting():