aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/util/remote_filesystem.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/util/remote_filesystem.rs')
-rw-r--r--crates/shirabe/src/util/remote_filesystem.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/shirabe/src/util/remote_filesystem.rs b/crates/shirabe/src/util/remote_filesystem.rs
index a244c9f9..2dafc0d3 100644
--- a/crates/shirabe/src/util/remote_filesystem.rs
+++ b/crates/shirabe/src/util/remote_filesystem.rs
@@ -1036,10 +1036,12 @@ impl RemoteFilesystem {
.unwrap_or(false);
if decode {
- let decoded = zlib_decode(result.as_deref().unwrap_or(""));
+ let decoded = zlib_decode(result.as_deref().unwrap_or("").as_bytes());
result = match decoded {
- Some(d) => Some(d),
+ // TODO(phase-e): byte-string semantics — the response body travels through
+ // RemoteFilesystem as a String; from_utf8_lossy can corrupt binary payloads
+ Some(d) => Some(String::from_utf8_lossy(&d).into_owned()),
None => {
return Err(anyhow::anyhow!(TransportException::new(
"Failed to decode zlib stream".to_string(),