🐛(backend) prevent regex from matching empty string
Rework regex pattern to exclude empty string matches since url_encoded_folder_path is optional. Add additional test cases covering edge cases and failure scenarios to improve validation coverage and prevent false positives.
This commit is contained in:
committed by
aleb_the_flash
parent
077d38f5e3
commit
de92d7d5ac
@@ -86,7 +86,7 @@ class MinioParser:
|
||||
|
||||
# pylint: disable=line-too-long
|
||||
self._filepath_regex = re.compile(
|
||||
r"(?P<url_encoded_folder_path>(?:[^%]+%2F)*)?(?P<recording_id>[0-9a-fA-F\-]{36})\.(?P<extension>[a-zA-Z0-9]+)"
|
||||
r"(?P<url_encoded_folder_path>(?:[^%]+%2F)+)?(?P<recording_id>[0-9a-fA-F\-]{36})\.(?P<extension>[a-zA-Z0-9]+)"
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user