1
0
mirror of https://github.com/vbrandl/bind9-api.git synced 2024-11-23 14:41:08 +01:00

Fix deprecation

This commit is contained in:
Valentin Brandl 2020-11-30 16:35:31 +01:00
parent 55aa95a41c
commit be5c8c6e62

View File

@ -104,7 +104,7 @@ pub struct Validated<T>(T);
impl<T: 'static + ::serde::de::DeserializeOwned> FromRequest<Arc<Config>> for Validated<T> { impl<T: 'static + ::serde::de::DeserializeOwned> FromRequest<Arc<Config>> for Validated<T> {
type Config = (); type Config = ();
type Result = Box<Future<Item = Self, Error = Error>>; type Result = Box<dyn Future<Item = Self, Error = Error>>;
fn from_request(req: &HttpRequest<Arc<Config>>, _: &Self::Config) -> Self::Result { fn from_request(req: &HttpRequest<Arc<Config>>, _: &Self::Config) -> Self::Result {
let state = req.state().clone(); let state = req.state().clone();
@ -134,7 +134,8 @@ impl<T> Deref for Validated<T> {
} }
fn extract_signature<S>(req: &HttpRequest<S>) -> Result<Vec<u8>> { fn extract_signature<S>(req: &HttpRequest<S>) -> Result<Vec<u8>> {
Ok(req.headers() Ok(req
.headers()
.get(::data::TOKEN_HEADER) .get(::data::TOKEN_HEADER)
.as_ref() .as_ref()
.ok_or_else(|| ErrorUnauthorized(ParseError::Header))? .ok_or_else(|| ErrorUnauthorized(ParseError::Header))?