еще раз изменил формат

This commit is contained in:
Mike0001-droid 2024-06-05 18:30:30 +05:00
parent addd388f91
commit 1bac65c096
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@ class FetchAndServeFile(ViewSet):
# Create a response with the appropriate content type and headers
file_response = HttpResponse(response.content, content_type='audio/mpeg')
file_response['Content-Disposition'] = 'attachment; filename="output.mp3"'
return Response(f'{file_response['Content-Disposition']}', status=status.HTTP_200_OK)
return Response(file_response, status=status.HTTP_200_OK)
except requests.RequestException as e:
return Response({'error': str(e)}, status=status.HTTP_400_BAD_REQUEST)