mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-22 03:49:18 +02:00
fix(slicer): encode file URL in protocol-handler scheme on Windows/Linux
"Open in Slicer" emitted `orcaslicer://open?file=<URL>` and `bambustudio://open?file=<URL>` by plain string concatenation, relying on a stale comment that claimed the browser preserves URLs in the query string. That ignores the slicer's own `url_decode()` on the received query (BS post_init → url_decode + split_str; OrcaSlicer Downloader regex + url_decode), so any already-percent-encoded character — most commonly `%20` from filenames with spaces — decoded to a literal space and the slicer's subsequent HTTP GET returned 0 bytes or 404. All three URL forms now use `encodeURIComponent()` (matching what the macOS `bambustudioopen://` branch was already doing, which is why the bug didn't surface on macOS). Corrected the file-level comment to document the actual invariant. Regression test in slicer.test.ts feeds the exact issue reproduction URL and asserts `%2520` appears in the generated href.
This commit is contained in:
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user