clippy
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
asonix 2023-01-09 16:31:01 -06:00
parent 1710719573
commit 9ae02a747f

View file

@ -83,14 +83,14 @@ async fn block_user_agents(
blocked: Rc<Vec<String>>,
) -> Result<ServiceResponse<impl MessageBody>, actix_web::Error> {
let Some(user_agent) = req.headers().get(USER_AGENT) else {
return Err(ErrorBadRequest(MissingUserAgent).into());
return Err(ErrorBadRequest(MissingUserAgent));
};
let user_agent = user_agent.to_str().map_err(ErrorBadRequest)?.to_lowercase();
for part in blocked.iter() {
if user_agent.contains(part.as_str()) {
return Err(ErrorBadRequest(InvalidUserAgent).into());
return Err(ErrorBadRequest(InvalidUserAgent));
}
}