summaryrefslogtreecommitdiff
path: root/webfinger.c
diff options
context:
space:
mode:
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);