Skip to content

Commit b0af383

Browse files
committed
Add strict export format check
1 parent e8a0bf5 commit b0af383

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cvat/apps/engine/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ def dataset_export(self, request, pk):
470470
if not dst_format:
471471
dst_format = DatumaroTask.DEFAULT_FORMAT
472472
dst_format = dst_format.lower()
473-
if 100 < len(dst_format) or not re.fullmatch(r"^[\w_-]+$", dst_format):
473+
if dst_format not in DatumaroTask.get_export_formats():
474474
raise serializers.ValidationError(
475475
"Unexpected parameter 'format' specified for the request")
476476

0 commit comments

Comments
 (0)