mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-17 19:36:28 +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
+1
-1
@@ -26,7 +26,7 @@
|
||||
|
||||
<!-- Splash screens for iOS -->
|
||||
<link rel="apple-touch-startup-image" href="/img/android-chrome-512x512.png" />
|
||||
<script type="module" crossorigin src="/assets/index-B2bhLHKc.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-DbCeLLRM.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-CiCRNaHx.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Reference in New Issue
Block a user