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

Accept Content-Disposition as header in GDS presign #556

Merged
merged 2 commits into from
Feb 22, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion data_portal/viewsets/gdsfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ def get_queryset(self):
@action(detail=True)
def presign(self, request, pk=None):
obj: GDSFile = self.get_object()
response = gds.presign_gds_file(file_id=obj.file_id, volume_name=obj.volume_name, path_=obj.path)

presigned_url_mode = request.headers.get('Content-Disposition')
response = gds.presign_gds_file(file_id=obj.file_id, volume_name=obj.volume_name, path_=obj.path,
presigned_url_mode=presigned_url_mode)

if response[0]:
return Response({'signed_url': response[1]})
else:
Expand Down