mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +01:00
fix(hyper-up): compatibility with hyper 0.6.4
* Signature of `client::Response` changed and now requires a `hyper::Url` as well. Closes #123
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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)">\
|
||||
|
||||
Reference in New Issue
Block a user