web: ignore whitespace in searched fingerprints

This commit is contained in:
Vincent Breitmoser 2019-07-03 15:44:40 +02:00
parent d79f5c3ef2
commit ab3f4006dd
No known key found for this signature in database
GPG Key ID: 7BD18320DEADFA11
1 changed files with 3 additions and 2 deletions

View File

@ -67,9 +67,10 @@ impl FromStr for Query {
return Err(failure::err_msg(
"Search by Short Key ID is not supported, sorry!"));
}
if let Ok(fp) = Fingerprint::from_str(term) {
let term_nospace = term.replace(" ", "");
if let Ok(fp) = Fingerprint::from_str(&term_nospace) {
Ok(ByFingerprint(fp))
} else if let Ok(keyid) = KeyID::from_str(term) {
} else if let Ok(keyid) = KeyID::from_str(&term_nospace) {
Ok(ByKeyID(keyid))
} else if let Ok(email) = Email::from_str(term) {
Ok(ByEmail(email))