mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-02 05:06:51 +08:00
S3 limits total request header/metadata size to 2 KB. Non-ASCII filenames expand significantly when percent-encoded in Content-Disposition, causing MetadataTooLarge errors on upload. Uses binary search to find the longest filename that keeps the full Content-Disposition header within safe bounds. Also adds a fallback that retries without Content-Disposition if MetadataTooLarge is raised. Additionally, the S3 migration now sets Content-Disposition on all files using the same inline/attachment logic as the S3 store, closing gaps where SVGs and files without upload records got no header. |
||
|---|---|---|
| .. | ||
| base_store_spec.rb | ||
| local_store_spec.rb | ||
| s3_store_spec.rb | ||