mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-24 21:40:48 +02:00
In plugins/fs/src/commands.rs write_file_inner, a malformed or non-ASCII `options` header was dropped with .ok(), so baseDir/append/createNew were silently ignored and the call became a truncating write to the raw path; the JSON array body fallback truncated values above 255 and dropped non-numbers. The header is parsed with parse_write_file_options: empty, `undefined` (what fetch sends for JSON.stringify(undefined)) and `null` mean no options, anything else must parse. Array bodies must only contain bytes. Unit test for the header parser; e2e spec for writes without options, which is the case the `undefined` handling keeps working.