Fetch User Keys - simple tool for fetching SSH keys from various sources
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

ft: normalise SourceHut username

+9 -1
+9 -1
cli/src/sources/mod.rs
··· 42 42 } 43 43 .fetch(), 44 44 Source::Sourcehut(ref user) => Http { 45 - url: format!("https://meta.sr.ht/{user}.keys"), 45 + url: format!("https://meta.sr.ht/{}.keys", normalize_sourcehut(user)), 46 46 } 47 47 .fetch(), 48 48 Source::Gitlab(ref user) => Http { ··· 55 55 .fetch(), 56 56 Source::Tangled(ref atproto) => atproto.fetch(), 57 57 } 58 + } 59 + } 60 + 61 + fn normalize_sourcehut<'a>(s: &'a str) -> std::borrow::Cow<'a, str> { 62 + if s.starts_with("~") { 63 + s.into() 64 + } else { 65 + format!("~{s}").into() 58 66 } 59 67 } 60 68