How to send a header in the send_file flask?

The problem is that I cannot send headers when using send_file , is there any workaround for this?

I want to be able to send headers when sending files to the client.

 return send_file(mp3_filepath, 'audio/mpeg') 
+7
python flask header sendfile
source share
1 answer
 response = make_response(send_file(mp3_filepath)) response.headers['X-Something'] = 'header value goes here' return response 
+11
source share

All Articles