mirror of
https://github.com/saltbo/zpan.git
synced 2026-10-30 18:31:36 +08:00
Uploading a file with a non-ASCII name (Chinese, emoji, …) failed with "Failed to execute 'setRequestHeader' on 'XMLHttpRequest': String contains non ISO-8859-1 code point." The presigned PUT's signed Content-Disposition put the raw filename in the plain `filename="..."` parameter, which the browser then rejects when setting it as an XHR request header. Add a shared attachmentContentDisposition() helper that keeps `filename=` ASCII-only and carries the real name in `filename*=UTF-8''`, and route all three construction sites through it so the signed and client-returned values stay identical (the value is part of the SigV4 signature). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>