Skip to content

Commit

Permalink
chore: lint code
Browse files Browse the repository at this point in the history
  • Loading branch information
kwaa committed Feb 2, 2024
1 parent 796359f commit 633b4f9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/routes/well_known/webfinger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ pub async fn webfinger(
} else {
// extract webfinger domain
let vec: Vec<&str> = query.resource.split('@').collect();
match vec[1] {
match vec.get(1) {
// acct:[email protected] => example.com
domain if domain == data.domain() => Ok(vec[0].trim_start_matches("acct:")),
Some(domain) if *domain == data.domain() => Ok(vec[0].trim_start_matches("acct:")),
// acct:[email protected] => example.com
domain if Url::parse(&format!("https://{domain}")).is_ok() => Ok(domain),
Some(domain) if Url::parse(&format!("https://{domain}")).is_ok() => Ok(*domain),
// acct:example.com@unknown => Err
_ => Err(AppError::not_found("Subject", &query.resource)),
}
Expand Down

0 comments on commit 633b4f9

Please sign in to comment.