Make queries case-insensitive

This commit is contained in:
Karcsesz 2024-02-14 23:30:33 +01:00
parent 6241d71f47
commit 8523e80e64
2 changed files with 2 additions and 2 deletions

View file

@ -4,7 +4,7 @@ use std::path::PathBuf;
pub fn query(database_path: PathBuf, handle: String) {
let data = LookupHandler::load(database_path).unwrap();
let resource = data.lookup(handle.trim()).unwrap();
let resource = data.lookup(handle.trim().to_lowercase().as_str()).unwrap();
serde_json::to_writer_pretty(stdout(), resource).unwrap();
println!()
}

View file

@ -111,7 +111,7 @@ async fn run_webfinger_query(
let resource = datastore
.read()
.await
.lookup(resource_query)
.lookup(resource_query.to_lowercase().as_str())
.ok_or(StatusCode::NOT_FOUND)?
.clone();
debug!("Found resource: {resource:?}");