I need to send a file stored in S3 through my rails application hosted on heroku. I cannot use a redirect to the URL of the file on S3 as I want to send a sitemap which should be served from the same domain as the links inside.
Ideally, I would use some sort of proxy method to send the file by the rails app, at least, I can download the file in the tmp directory of heroku and send it after.
I would also send the right content-type for the file.
Do you know how can I achieve it ? What will be the best way ?
There is a rack app which is doing that but I'm not sure how to reproduce it in Rails, see the code here
Thanks for your help