Skip to content

Commit

Permalink
Add strict export format check
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiltsov-max committed Nov 14, 2019
1 parent 3ac2ff7 commit 1d52b3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cvat/apps/engine/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def dataset_export(self, request, pk):
if not dst_format:
dst_format = DatumaroTask.DEFAULT_FORMAT
dst_format = dst_format.lower()
if 100 < len(dst_format) or not re.fullmatch(r"^[\w_-]+$", dst_format):
if dst_format not in DatumaroTask.get_export_formats():
raise serializers.ValidationError(
"Unexpected parameter 'format' specified for the request")

Expand Down

0 comments on commit 1d52b3d

Please sign in to comment.