Fix splitting logic for serve args (#4695)

Using .split(' ') for cli arguments causes extra whitespace to become extra
arguments, and "".split(' ') returns the empty string instead of nothing.
Using split_whitespace() fixes both of these problems.

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
This commit is contained in:
Kristoffer SøholmandJonathan Kelley authored and GitHub committed 2025-10-03 18:33:45 -07:00
1 parent 6456576a77
commit 8d26a5d22e
1 file changed
+6 -1
+6 -1
View File
@@ -101,7 +101,12 @@ impl AppServer {
let cross_origin_policy = args.cross_origin_policy;
// Find the launch args for the client and server
let split_args = |args: &str| args.split(' ').map(|s| s.to_string()).collect::<Vec<_>>();
let split_args = |args: &str| {
args.split_whitespace()
.map(|s| s.to_string())
.collect::<Vec<_>>()
};
let server_args = args.platform_args.with_server_or_shared(|c| &c.args);
let server_args = split_args(server_args);
let client_args = args.platform_args.with_client_or_shared(|c| &c.args);