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(, 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):

After upgrade (download as attachment):