Shrine

Content_disposition=inline vs attachment when manually uploading file

I use Shrine to manually upload a file on active record object:

file_name = "/var/tmp/generated_file.mp3"
user = User.find(..)
user.file_attacher.assign(File.open(file, binmode: true), upload_options: { acl: "public-read" })

I noticed that files ARE saved to S3 but they are being automatically downloaded to the downloads folder when file is requested via URL. I would prefer to have: content_disposition: “inline” (which should be default?).

It is super weird because all files which are uploaded via html form are downloaded inline. Setting with content_disposition: "attachment" doesn’t exist anywhere in the code. I want inline files everywhere!

Which setting could be responsible for this behaviour?

This problem started occurring once I upgraded Rails from 5 to 6. I also upgraded ruby version from 2.6.1 to 2.7.3. Any idea why?

File example before upgrade (downloaded inline):
__https://s3.us-east-2.amazonaws.com/staging-cdn.adbarker.com/cache/podcasts/WpRrubQRT8P72DvjNpzusx1Y/episodes/eebd4a6336bf11bedd8d4c90ad467c7b.mp3

After upgrade (download as attachment):
__https://s3.us-east-2.amazonaws.com/staging-cdn.adbarker.com/cache/podcasts/WpRrubQRT8P72DvjNpzusx1Y/episodes/2e37ccf03e00e7c21cab0202d1c176e9.mp3