-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add public interface to Multipart's Part headers
#1687
Conversation
@seanmonstar is this project open to PRs? |
Yes it is, sorry, got lost in a short week. |
Oh no worries! Let me know if anything needs to be changed in this proposal EDIT : looks like a missed a |
The CI failures seem unrelated to the code itself |
@seanmonstar hope you had a good holiday season and started the new year well! I have merged master into my branch so hopefully everything should be green on the CI side now. Best |
use mime_guess::Mime; | ||
use percent_encoding::{self, AsciiSet, NON_ALPHANUMERIC}; | ||
|
||
use futures_core::Stream; | ||
use futures_util::{future, stream, StreamExt}; | ||
|
||
use super::Body; | ||
use crate::header::HeaderMap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought this made sense since the request.rs also uses the re-exported HeaderMap
* feat(async_impl): set custom headers on multipart Part * feat(blocking): set custom headers on multipart * test(multipart): use new method to add custom headers * fix: missing import * refactor(multipart): use concrete type for headers setter arg
I have an application where I'd like to add compressed files to a multipart form request, and would like to set the
content-encoding
header for said files in the request. However, the current implementation doesn't allow editing the metadata onmultipart::Part
s. I added the necessary public setters to be able to to add custom headers to the multipart items.