mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-09 06:34:52 +08:00
Related: https://github.com/discourse/discourse/pull/30535 In the PR above, the [content-disposition header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition) was removed for all non-svg files due to the "attachment" keyword added to them, causing files to be downloaded instead of opening in a new tab when requested. When removing that, it also removed the filename attribute attached to s3 uploads. After some testing, it turns out that `filename` is also respected when next to `inline`, despite it not being obvious [in docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition#syntax). This commit adds inline+filename so that users can still download files and have filenames be respected instead of using the s3 hash. ```http <!-- mdn docs --> Content-Disposition: inline Content-Disposition: attachment Content-Disposition: attachment; filename="file name.jpg" Content-Disposition: attachment; filename*=UTF-8''file%20name.jpg <!-- this actually works too --> Content-Disposition: inline; filename="file name.jpg" ``` |
||
|---|---|---|
| .. | ||
| distributed_cache_spec.rb | ||
| flags_spec.rb | ||
| hashtag_autocomplete_service_spec.rb | ||
| jobs_spec.rb | ||
| pausable_multisite_spec.rb | ||
| post_spec.rb | ||
| request_tracker_spec.rb | ||
| s3_store_spec.rb | ||
| site_settings_spec.rb | ||