изменил формат возврата файла аудио
This commit is contained in:
parent
cafe5588f7
commit
bdfe06c849
|
|
@ -24,8 +24,8 @@ class FetchAndServeFile(ViewSet):
|
||||||
# Create a response with the appropriate content type and headers
|
# Create a response with the appropriate content type and headers
|
||||||
file_response = HttpResponse(response.content, content_type='audio/mpeg')
|
file_response = HttpResponse(response.content, content_type='audio/mpeg')
|
||||||
file_response['Content-Disposition'] = 'attachment; filename="output.mp3"'
|
file_response['Content-Disposition'] = 'attachment; filename="output.mp3"'
|
||||||
|
return Response(f'{file_response}', status=status.HTTP_200_OK)
|
||||||
return file_response
|
|
||||||
except requests.RequestException as e:
|
except requests.RequestException as e:
|
||||||
return Response({'error': str(e)}, status=status.HTTP_400_BAD_REQUEST)
|
return Response({'error': str(e)}, status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue