From 8118e94430c7dd85d58648ae7392037e7fa0d5ef Mon Sep 17 00:00:00 2001 From: nazeh Date: Wed, 28 Aug 2024 20:39:32 +0300 Subject: [PATCH] fix(pubky): return error if resolve_endpoint couldn't find non Pkarr domain --- pubky/src/shared/pkarr.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pubky/src/shared/pkarr.rs b/pubky/src/shared/pkarr.rs index fa3f866..7a29e2e 100644 --- a/pubky/src/shared/pkarr.rs +++ b/pubky/src/shared/pkarr.rs @@ -137,6 +137,10 @@ impl PubkyClient { } } + if PublicKey::try_from(origin.as_str()).is_ok() { + return Err(Error::ResolveEndpoint(original_target.into())); + } + if let Some(public_key) = endpoint_public_key { let url = Url::parse(&format!( "{}://{}",