Skip to content

[Rust Server] Improve RFC 13341 compliance for multipart/related #19355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@
{{#-last}}

// Write the body into a vec.
let mut body: Vec<u8> = vec![];
// RFC 13341 Section 7.2.1 suggests that the body should begin with a
// CRLF prior to the first boundary. The mime_multipart library doesn't
// do this, so we do it instead.
let mut body: Vec<u8> = vec![b'\r', b'\n'];
write_multipart(&mut body, &boundary, &body_parts)
.expect("Failed to write multipart body");
{{/-last}}
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,10 @@ impl<S, C> Api<C> for Client<S, C> where
}

// Write the body into a vec.
let mut body: Vec<u8> = vec![];
// RFC 13341 Section 7.2.1 suggests that the body should begin with a
// CRLF prior to the first boundary. The mime_multipart library doesn't
// do this, so we do it instead.
let mut body: Vec<u8> = vec![b'\r', b'\n'];
write_multipart(&mut body, &boundary, &body_parts)
.expect("Failed to write multipart body");

Expand Down Expand Up @@ -759,7 +762,10 @@ impl<S, C> Api<C> for Client<S, C> where
}

// Write the body into a vec.
let mut body: Vec<u8> = vec![];
// RFC 13341 Section 7.2.1 suggests that the body should begin with a
// CRLF prior to the first boundary. The mime_multipart library doesn't
// do this, so we do it instead.
let mut body: Vec<u8> = vec![b'\r', b'\n'];
write_multipart(&mut body, &boundary, &body_parts)
.expect("Failed to write multipart body");

Expand Down
Loading