mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +01:00
fix(lib): use hyper Bearer header style
Considering we kind-of hardcoded this authentication type anyway, we now use the Auth-types provided by hyper 0.8. The incentive here was the compiler telling us that there the yup-oauth::Scheme type doesn't implement the hyper::authorization::Scheme anymore, even though that clearly was the case. Also it couldn't be reproduced in yup-oauth itself. This will need some work to get correct again, so this is just a crude patch to make it work again.
This commit is contained in:
@@ -484,7 +484,7 @@ match result {
|
||||
use url::percent_encoding::{percent_encode, FORM_URLENCODED_ENCODE_SET};
|
||||
% endif
|
||||
use std::io::{Read, Seek};
|
||||
use hyper::header::{ContentType, ContentLength, Authorization, UserAgent, Location};
|
||||
use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location};
|
||||
let mut dd = DefaultDelegate;
|
||||
let mut dlg: &mut Delegate = match ${delegate} {
|
||||
Some(d) => d,
|
||||
@@ -690,8 +690,7 @@ else {
|
||||
}
|
||||
}
|
||||
};
|
||||
let auth_header = Authorization(oauth2::Scheme { token_type: oauth2::TokenType::Bearer,
|
||||
access_token: token.access_token });
|
||||
let auth_header = Authorization(Bearer { token: token.access_token });
|
||||
% endif
|
||||
% if request_value:
|
||||
request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user