discourse/spec/lib/file_store
Gerhard Schlager 8d5c0c5426
FIX: Truncate long filenames in S3 Content-Disposition header (#39170)
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.
2026-04-13 10:14:06 +02:00
..
base_store_spec.rb FIX: Enforce content disposition on S3 presigned URLs (#38850) 2026-03-27 10:04:00 +08:00
local_store_spec.rb DEV: Allow fab! without block (#24314) 2023-11-09 16:47:59 -06:00
s3_store_spec.rb FIX: Truncate long filenames in S3 Content-Disposition header (#39170) 2026-04-13 10:14:06 +02:00