mirror of
https://git.asonix.dog/asonix/http-signature-normalization.git
synced 2024-11-22 01:11:00 +00:00
Clippy
This commit is contained in:
parent
efc55fd9a1
commit
92a6f53dd6
2 changed files with 9 additions and 11 deletions
|
@ -504,7 +504,7 @@ impl Config {
|
||||||
|
|
||||||
let unsigned = self
|
let unsigned = self
|
||||||
.config
|
.config
|
||||||
.begin_sign(&method.to_string(), &path_and_query, headers)?;
|
.begin_sign(method.as_ref(), &path_and_query, headers)?;
|
||||||
|
|
||||||
Ok(self::create::Unsigned { unsigned })
|
Ok(self::create::Unsigned { unsigned })
|
||||||
}
|
}
|
||||||
|
@ -528,7 +528,7 @@ impl Config {
|
||||||
|
|
||||||
let unverified = self
|
let unverified = self
|
||||||
.config
|
.config
|
||||||
.begin_verify(&method.to_string(), &path_and_query, headers)?;
|
.begin_verify(method.as_ref(), &path_and_query, headers)?;
|
||||||
|
|
||||||
Ok(unverified)
|
Ok(unverified)
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,15 +67,13 @@ where
|
||||||
E: From<JoinError> + From<PrepareSignError> + std::fmt::Debug + Send + 'static,
|
E: From<JoinError> + From<PrepareSignError> + std::fmt::Debug + Send + 'static,
|
||||||
K: Display,
|
K: Display,
|
||||||
{
|
{
|
||||||
if config.set_date {
|
if config.set_date && !request.headers().contains_key("date") {
|
||||||
if !request.headers().contains_key("date") {
|
request.headers_mut().insert(
|
||||||
request.headers_mut().insert(
|
actix_http::header::DATE,
|
||||||
actix_http::header::DATE,
|
HttpDate::from(SystemTime::now())
|
||||||
HttpDate::from(SystemTime::now())
|
.try_into_value()
|
||||||
.try_into_value()
|
.expect("Date is valid"),
|
||||||
.expect("Date is valid"),
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut headers = request.headers().clone();
|
let mut headers = request.headers().clone();
|
||||||
|
|
Loading…
Reference in a new issue