Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: LEAP-176: set up CSP in Label Studio #5137

Merged
merged 10 commits into from
Dec 7, 2023
Prev Previous commit
Next Next commit
remove earlier header setup
  • Loading branch information
jombooth committed Dec 4, 2023
commit 92fa7cff25f25ccae7d920935c3ac2d8dbc38f66
7 changes: 2 additions & 5 deletions label_studio/data_import/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,12 +616,9 @@ def get(self, *args, **kwargs):
if file.storage.exists(file.name):
content_type, encoding = mimetypes.guess_type(str(file.name))
content_type = content_type or 'application/octet-stream'
resp = RangedFileResponse(request, file.open(mode='rb'), content_type=content_type)
else:
resp = Response(status=status.HTTP_404_NOT_FOUND)
return RangedFileResponse(request, file.open(mode='rb'), content_type=content_type)

resp['override-report-only-csp'] = True
return resp
return Response(status=status.HTTP_404_NOT_FOUND)


class DownloadStorageData(APIView):
Expand Down
Loading