clippy
This commit is contained in:
parent
1710719573
commit
9ae02a747f
1 changed files with 2 additions and 2 deletions
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue