Skip to content

Commit 1801581

Browse files
triklozoidJalal Tabatabaee
authored andcommitted
fix: DEV-4039: Download storage empty path (HumanSignal#3448)
1 parent 7d292fe commit 1801581

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

label_studio/data_import/api.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,10 @@ def get(self, request, *args, **kwargs):
487487
""" Get export files list
488488
"""
489489
request = self.request
490+
filepath = request.GET.get('filepath')
491+
if filepath is None:
492+
return Response(status=status.HTTP_404_NOT_FOUND)
493+
490494
filepath = unquote(request.GET['filepath'])
491495

492496
url = None
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
test_name: tasks_download_storage
3+
strict: false
4+
marks:
5+
- usefixtures:
6+
- django_live_url
7+
stages:
8+
- name: without auth
9+
request:
10+
method: GET
11+
url: '{django_live_url}/storage-data/uploaded/'
12+
response:
13+
status_code: 401
14+
- id: signup
15+
type: ref
16+
- name: empty filepath
17+
request:
18+
method: GET
19+
url: '{django_live_url}/storage-data/uploaded/'
20+
response:
21+
status_code: 404
22+
- name: access denied
23+
request:
24+
method: GET
25+
url: '{django_live_url}/storage-data/uploaded/?filepath=test'
26+
response:
27+
status_code: 403

0 commit comments

Comments
 (0)