summaryrefslogtreecommitdiff
path: root/webfinger.c
diff options
context:
space:
mode:
authorgrunfink <grunfink@noreply.codeberg.org>2024-04-18 15:12:47 +0000
committergrunfink <grunfink@noreply.codeberg.org>2024-04-18 15:12:47 +0000
commit100c9cf569ef4497160ac60a55f5b94b9cb524bc (patch)
tree30791ca1d83e2b94787e42432898ac7b2c7f7943 /webfinger.c
parent44d126e0f96748f7f5e0c8a95ed8b3f5f69cd0f0 (diff)
parent7312f4ce51100d4ed98988cb3af0ab06e4fba53c (diff)
Merge pull request 'Ability to federate with hidden networks #93 (update for v2.49)' (#149) from iwojima/snac2:master into master
Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/149
Diffstat (limited to 'webfinger.c')
-rw-r--r--webfinger.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/webfinger.c b/webfinger.c
index a883d7f..331191b 100644
--- a/webfinger.c
+++ b/webfinger.c
@@ -19,9 +19,10 @@ int webfinger_request_signed(snac *snac, const char *qs, char **actor, char **us
xs_str *host = NULL;
xs *resource = NULL;
- if (xs_startswith(qs, "https:/" "/")) {
+ if (xs_startswith(qs, "http")) {
/* actor query: pick the host */
- xs *s = xs_replace_n(qs, "https:/" "/", "", 1);
+ xs *s1 = xs_replace_n(qs, "http:/" "/", "", 1);
+ xs *s = xs_replace_n(s1, "https:/" "/", "", 1);
l = xs_split_n(s, "/", 1);
@@ -69,7 +70,7 @@ int webfinger_request_signed(snac *snac, const char *qs, char **actor, char **us
&payload, &p_size, &ctype);
}
else {
- xs *url = xs_fmt("https:/" "/%s/.well-known/webfinger?resource=%s", host, resource);
+ xs *url = xs_fmt("http:/" "/%s/.well-known/webfinger?resource=%s", host, resource);
if (snac == NULL)
xs_http_request("GET", url, headers, NULL, 0, &status, &payload, &p_size, 0);
@@ -139,7 +140,7 @@ int webfinger_get_handler(xs_dict *req, char *q_path,
snac snac;
int found = 0;
- if (xs_startswith(resource, "https:/" "/")) {
+ if (xs_startswith(resource, "https")) {
/* actor search: find a user with this actor */
xs *l = xs_split(resource, "/");
char *uid = xs_list_get(l, -1);