Skip to content

Commit

Permalink
fix(hyper-up): compatibility with hyper 0.6.4
Browse files Browse the repository at this point in the history
* Signature of `client::Response` changed and now requires a
  `hyper::Url` as well.

 Closes #123
  • Loading branch information
Byron committed Jul 15, 2015
1 parent 2575d5a commit e129a7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/mako/Cargo.toml.mako
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ name = "${util.program_name()}"
% endif
[dependencies]
hyper = ">= 0.6.0"
hyper = ">= 0.6.4"
## Must match the one hyper uses, otherwise there are duplicate similarly named `Mime` structs
mime = "0.0.12"
serde = ">= 0.4.1"
Expand Down
15 changes: 6 additions & 9 deletions src/mako/api/lib/mbuild.mako
Original file line number Diff line number Diff line change
Expand Up @@ -703,15 +703,12 @@ else {
if should_ask_dlg_for_url && (upload_url = dlg.upload_url()) == () && upload_url.is_some() {
should_ask_dlg_for_url = false;
upload_url_from_server = false;
let mut response = hyper::client::Response::new(Box::new(cmn::DummyNetworkStream));
match response {
Ok(ref mut res) => {
res.status = hyper::status::StatusCode::Ok;
res.headers.set(Location(upload_url.as_ref().unwrap().clone()))
}
_ => unreachable!(),
}
response
let url = upload_url.as_ref().and_then(|s| Some(hyper::Url::parse(s).unwrap())).unwrap();
hyper::client::Response::new(url, Box::new(cmn::DummyNetworkStream)).and_then(|mut res| {
res.status = hyper::status::StatusCode::Ok;
res.headers.set(Location(upload_url.as_ref().unwrap().clone()));
Ok(res)
})
} else {
% endif
<%block filter="indent_by(resumable_media_param and 4 or 0)">\
Expand Down

0 comments on commit e129a7d

Please sign in to comment.