Repository navigation
Set a default filename so that Slack displays the file preview correctly - #599
Conversation
Danger ReportNo issues found. |
f4e5f47 to
db550e0
Compare
Fixes files_upload not showing image previews when filename is not specified, since multipart-post falls back to the local IO path as the filename, which Slack treats as a binary file. Co-authored-by: ts-3156 <ts_3156@yahoo.co.jp> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
AI posting on behalf of @dblock: rebased onto current master and added regression coverage for the default filename, explicit filenames, content-only uploads, and preserving the caller’s options hash. The full |
db550e0 to
174eee9
Compare
|
@dblock just to check, did you intend to commit the git patch as its own file (https://github.com/slack-ruby/slack-ruby-client/blob/f22db735afae2d343ad44c09f469515893cc440c/lib/slack/web/api/patches/files.default-filename.patch)? |
Yes, see https://github.com/slack-ruby/slack-ruby-client/blob/master/CONTRIBUTING.md#patching-slack-web-api. |
Finishes #375 as a patch.
Since 2021/05/05, Slack no longer correctly displays image previews for files uploaded via
files_uploadwhen no filename is specified.Faraday::UploadIO/multipart-post falls back to the local IO path as the filename in that case, and Slack treats the file as binary if the filename looks like a path.This sets a default filename of
'file'when:fileis present but:filenameis not, matching the fix originally proposed in #375 by @ts-3156.Closes #375.