Skip to content

Commit

Permalink
Fix ManageSieve GETSCRIPT response: Add missing CRLF
Browse files Browse the repository at this point in the history
  • Loading branch information
Megver83 committed Jun 25, 2024
1 parent 50a2f50 commit 5a93fe2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/managesieve/src/op/getscript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl<T: AsyncRead + AsyncWrite> Session<T> {
.blob_id()
.and_then(|id| (id.section.as_ref()?.clone(), id.hash.clone()).into())
.ok_or_else(|| {
StatusResponse::no("Filed to retrieve blobId").with_code(ResponseCode::TryLater)
StatusResponse::no("Failed to retrieve blobId").with_code(ResponseCode::TryLater)
})?;
let script = self
.jmap
Expand All @@ -50,11 +50,12 @@ impl<T: AsyncRead + AsyncWrite> Session<T> {
})?;
debug_assert_eq!(script.len(), blob_section.size);

let mut response = Vec::with_capacity(script.len() + 30);
let mut response = Vec::with_capacity(script.len() + 32);
response.push(b'{');
response.extend_from_slice(blob_section.size.to_string().as_bytes());
response.extend_from_slice(b"}\r\n");
response.extend(script);
response.extend_from_slice(b"\r\n");

Ok(StatusResponse::ok("").serialize(response))
}
Expand Down

0 comments on commit 5a93fe2

Please sign in to comment.