Skip to content
Open
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
11 changes: 11 additions & 0 deletions src/async_impl/multipart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@ impl Form {
self.inner.boundary()
}

/// Set the boundary that this form will use. By default the boundary is a
/// long random string to minimize the risk of the boundary appearing in
/// the body content.
///
/// **Setting a custom boundary incurs significant risk of generating
/// corrupted bodies.** Only use this if you need it and you understand the
/// risk!
pub fn set_boundary(&mut self, boundary: impl Into<String>) {
self.inner.boundary = boundary.into();
}

/// Add a data field with supplied name and value.
///
/// # Examples
Expand Down
11 changes: 11 additions & 0 deletions src/blocking/multipart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,17 @@ impl Form {
self.inner.boundary()
}

/// Set the boundary that this form will use. By default the boundary is a
/// long random string to minimize the risk of the boundary appearing in
/// the body content.
///
/// **Setting a custom boundary incurs significant risk of generating
/// corrupted bodies.** Only use this if you need it and you understand the
/// risk!
pub fn set_boundary(&mut self, boundary: impl Into<String>) {
self.inner.boundary = boundary.into();
}

/// Add a data field with supplied name and value.
///
/// # Examples
Expand Down
Loading