summaryrefslogtreecommitdiff
path: root/webfinger.c
diff options
context:
space:
mode:
authorGravatar default2024-05-22 16:14:58 +0200
committerGravatar default2024-05-22 16:14:58 +0200
commit63e0ca5abac0f00121f724927c25edaf822097a9 (patch)
tree41ec746f39f572fe6dde5b254550821b276f6044 /webfinger.c
parentMerge pull request 'Change WebFinger content type to RFC-required type' (#167... (diff)
downloadsnac2-63e0ca5abac0f00121f724927c25edaf822097a9.tar.gz
snac2-63e0ca5abac0f00121f724927c25edaf822097a9.tar.xz
snac2-63e0ca5abac0f00121f724927c25edaf822097a9.zip
Also return an application/ld+json object in webfinger.
Diffstat (limited to '')
-rw-r--r--webfinger.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/webfinger.c b/webfinger.c
index cad86e4..b1d85e9 100644
--- a/webfinger.c
+++ b/webfinger.c
@@ -103,7 +103,8 @@ int webfinger_request_signed(snac *snac, const char *qs, char **actor, char **us
103 const char *type = xs_dict_get(v, "type"); 103 const char *type = xs_dict_get(v, "type");
104 104
105 if (type && (strcmp(type, "application/activity+json") == 0 || 105 if (type && (strcmp(type, "application/activity+json") == 0 ||
106 strcmp(type, "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"") == 0)) { 106 strcmp(type, "application/ld+json; profile=\"https:/"
107 "/www.w3.org/ns/activitystreams\"") == 0)) {
107 *actor = xs_dup(xs_dict_get(v, "href")); 108 *actor = xs_dup(xs_dict_get(v, "href"));
108 break; 109 break;
109 } 110 }
@@ -189,6 +190,12 @@ int webfinger_get_handler(xs_dict *req, char *q_path,
189 190
190 links = xs_list_append(links, aaj); 191 links = xs_list_append(links, aaj);
191 192
193 /* duplicate with the ld+json type */
194 aaj = xs_dict_set(aaj, "type", "application/ld+json; profile=\"https:/"
195 "/www.w3.org/ns/activitystreams\"");
196
197 links = xs_list_append(links, aaj);
198
192 prof = xs_dict_append(prof, "rel", "http://webfinger.net/rel/profile-page"); 199 prof = xs_dict_append(prof, "rel", "http://webfinger.net/rel/profile-page");
193 prof = xs_dict_append(prof, "type", "text/html"); 200 prof = xs_dict_append(prof, "type", "text/html");
194 prof = xs_dict_append(prof, "href", snac.actor); 201 prof = xs_dict_append(prof, "href", snac.actor);