Closed Ogeon closed 9 years ago
This looks pretty good, the only recommendation I would give in general is maybe consider putting the multipart
stuff behind a feature so people can opt-out if they want. It can be on by default, I just think people would appreciate having the option.
Good point. Its not really intrusive, but it does come with a small runtime overhead. Being able to turn it off sounds good. Thank you for your advice :smile:
I'll look into this and why it breaks on Windows (possibly a Rust version issue) as soon as possible.
Hyper added SSL support and it's a bit broken cause it needs libopenssl
. I have it installed but it still doesn't work. Check my Cargo.toml
to see how I made it work without disabling SSL entirely.
I have set it up to download and install OpenSSL, so that's no problem (except for the occasional version change). This break is caused by winapi not finding std::os::raw
. I have been a bit conservative when it comes to what Rust version I test with, and decided to stay at 1.0.0 until I'm forced to upgrade.
Oh, wow. I use a nightly and upgrade whenever I think it's prudent. It's okay to use nightlies because as long as you don't have any #![feature(...)]
annotations in your crate, it is basically guaranteed to work on the latest stable release. And you can always configure Travis CI to check against both the nightly and release branches (and beta too if you care that much).
I'm usually following stable, but I thought that I should make this build as far back as possible without sacrificing functionality and so far so good, until today. It wasn't really a promise, but I didn't want to break it unless I had to. Seems like it's finally time to bump the lowest supported version for Windows.
I think I managed to include all the suggested changes. The only thing left, then, is a proper description of as_multipart
with an example (unless something else comes up).
I think this is it, unless I have been too distracted and missed something... What do you think @cybergeek94?
I have a PR on multipart
waiting for Travis CI checks to pass: https://github.com/cybergeek94/multipart/pull/19.
It doesn't break the server API but it introduces some much-needed fixes. I recommend testing against it once I merge it.
Additionally, I might just go ahead and refactor out HttpRequest::is_multipart()
, and rename boundary()
to multipart_boundary()
to make the semantics clearer. Since this would be a breaking change, it'd necessitate bumping the version to 0.3
. I'd also take this opportunity to fix a nit I've had with the client API for a while now.
Sounds good. Just notify me when 0.3 is ready and I'll make the change.
0.3.0
is uploaded to crates. PR: https://github.com/cybergeek94/multipart/pull/20
Oh, that was quick :smile: I'll update it in a moment...
...and there it is!
Ok, that's it. This is done. Thank you, @cybergeek94, for helping me reviewing it! It has been really helpful :smile:
@homu r+
:pushpin: Commit e8acf52 has been approved by Ogeon
:hourglass: Testing commit e8acf52 with merge b014b4f...
:+1:
This adds support for requests with the type
multipart/form-data
to theBodyReader
. The solution has also been discussed in #49 and (mainly) consists of adding anas_multipart
method toBodyReader
and amultipart
cargo feature that toggles it.The changes here breaks the
from_reader
method onBodyReader
, which is really an internal method. I would like to consider it highly unstable for now, so this is still a minor change.Closes #49