diff --git a/src/wasm/multipart.rs b/src/wasm/multipart.rs index 909875c0a..f676784d2 100644 --- a/src/wasm/multipart.rs +++ b/src/wasm/multipart.rs @@ -172,6 +172,11 @@ impl Part { self.with_inner(move |inner| inner.file_name(filename)) } + /// Sets custom headers for the part. + pub fn headers(self, headers: HeaderMap) -> Part { + self.with_inner(move |inner| inner.headers(headers)) + } + fn with_inner(self, func: F) -> Self where F: FnOnce(PartMetadata) -> PartMetadata, @@ -262,6 +267,14 @@ impl PartMetadata { self.file_name = Some(filename.into()); self } + + pub(crate) fn headers(mut self, headers: T) -> Self + where + T: Into, + { + self.headers = headers.into(); + self + } } impl PartMetadata {