From f0a032044bc4da3d5baa3188c76f37d6f3cc1038 Mon Sep 17 00:00:00 2001 From: default Date: Sun, 24 Mar 2024 06:15:53 +0100 Subject: [PATCH] In the 'ping' cmdline, really resolve via webfinger if necessary. --- main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.c b/main.c index 87aa2c1..a5921d8 100644 --- a/main.c +++ b/main.c @@ -361,6 +361,14 @@ int main(int argc, char *argv[]) if (strcmp(cmd, "ping") == 0) { /** **/ xs *actor_o = NULL; + if (!xs_startswith(url, "https:/")) { + /* try to resolve via webfinger */ + if (!valid_status(webfinger_request(url, &url, NULL))) { + srv_log(xs_fmt("cannot resolve %s via webfinger", url)); + return 1; + } + } + if (valid_status(actor_request(&snac, url, &actor_o))) { xs *msg = msg_ping(&snac, url);