From 21fa6c7904bfd0e74b2251409f0c65d2c0aabe02 Mon Sep 17 00:00:00 2001 From: default Date: Sun, 23 Apr 2023 14:33:53 +0200 Subject: [PATCH] Strip the query string in msg_follow(). --- activitypub.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/activitypub.c b/activitypub.c index 73225ac..b20ae0f 100644 --- a/activitypub.c +++ b/activitypub.c @@ -659,7 +659,7 @@ d_char *msg_delete(snac *snac, char *id) } -xs_dict *msg_follow(snac *snac, const char *url_or_uid) +xs_dict *msg_follow(snac *snac, const char *q) /* creates a 'Follow' message */ { xs *actor_o = NULL; @@ -667,6 +667,8 @@ xs_dict *msg_follow(snac *snac, const char *url_or_uid) d_char *msg = NULL; int status; + xs *url_or_uid = xs_strip_i(xs_str_new(q)); + if (xs_startswith(url_or_uid, "https:/")) actor = xs_dup(url_or_uid); else