Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/runtime/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,19 @@ impl<const SSL: bool, const DEBUG: bool> NewServer<SSL, DEBUG> {
port: None,
}
} else {
#[cfg(windows)]
let hostname = {
// On Windows, convert backslashes to forward slashes for valid URL format
// Also handle drive letters like C:\test -> C:/test
let path = std::str::from_utf8(unix).unwrap_or("");
let converted = path.replace('\\', "/");
converted.into_bytes()
};
#[cfg(not(windows))]
let hostname = unix.to_vec();
URLFormatter {
proto: URLProto::Unix,
hostname: Some(unix),
hostname: Some(&hostname),
port: None,
}
}
Expand Down