Broken pipe error when uploading to a S3 clone, a pdf with a name containing é,ï etc

Line 62 of https://github.com/discourse/discourse/blob/master/lib/file_store/s3_store.rb

options[:content_disposition] = "attachment; filename=\"#{filename}\""

the content disposition should perhaps be formated

options[:content_disposition] = ActionDispatch::Http::ContentDisposition.format(
        disposition: "attachment", filename: upload.filename
      )

as in
https://github.com/discourse/discourse/commit/24877a7b8c3aa445f0969b298ba8a34ac57c7bd6

if so, maybe these content_disposition too:
https://github.com/discourse/discourse/commit/e5da2d24e543c86868768de235b8eedab1ee6ee1

4 Likes