mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
Don't set content-disposition header for images
If this header is set for images, clicking the image link causes them to automatically download the file, rather than viewing it inside the browser. This commit forces this behavior only for uploads that aren't images
This commit is contained in:
parent
7f498a8795
commit
80468037e9
1 changed files with 5 additions and 1 deletions
|
@ -139,7 +139,11 @@ module FileStore
|
|||
public: true,
|
||||
body: file
|
||||
}
|
||||
args[:content_disposition] = "attachment; filename=\"#{filename}\"" if filename
|
||||
|
||||
if filename && !FileHelper.is_image?(filename)
|
||||
args[:content_disposition] = "attachment; filename=\"#{filename}\""
|
||||
end
|
||||
|
||||
args[:content_type] = content_type if content_type
|
||||
|
||||
get_or_create_directory(s3_bucket).files.create(args)
|
||||
|
|
Loading…
Reference in a new issue