mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-09 19:50:26 +03:00
Also return an application/ld+json object in webfinger.
This commit is contained in:
parent
76f20bb79e
commit
63e0ca5aba
@ -103,7 +103,8 @@ int webfinger_request_signed(snac *snac, const char *qs, char **actor, char **us
|
|||||||
const char *type = xs_dict_get(v, "type");
|
const char *type = xs_dict_get(v, "type");
|
||||||
|
|
||||||
if (type && (strcmp(type, "application/activity+json") == 0 ||
|
if (type && (strcmp(type, "application/activity+json") == 0 ||
|
||||||
strcmp(type, "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"") == 0)) {
|
strcmp(type, "application/ld+json; profile=\"https:/"
|
||||||
|
"/www.w3.org/ns/activitystreams\"") == 0)) {
|
||||||
*actor = xs_dup(xs_dict_get(v, "href"));
|
*actor = xs_dup(xs_dict_get(v, "href"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -189,6 +190,12 @@ int webfinger_get_handler(xs_dict *req, char *q_path,
|
|||||||
|
|
||||||
links = xs_list_append(links, aaj);
|
links = xs_list_append(links, aaj);
|
||||||
|
|
||||||
|
/* duplicate with the ld+json type */
|
||||||
|
aaj = xs_dict_set(aaj, "type", "application/ld+json; profile=\"https:/"
|
||||||
|
"/www.w3.org/ns/activitystreams\"");
|
||||||
|
|
||||||
|
links = xs_list_append(links, aaj);
|
||||||
|
|
||||||
prof = xs_dict_append(prof, "rel", "http://webfinger.net/rel/profile-page");
|
prof = xs_dict_append(prof, "rel", "http://webfinger.net/rel/profile-page");
|
||||||
prof = xs_dict_append(prof, "type", "text/html");
|
prof = xs_dict_append(prof, "type", "text/html");
|
||||||
prof = xs_dict_append(prof, "href", snac.actor);
|
prof = xs_dict_append(prof, "href", snac.actor);
|
||||||
|
Loading…
Reference in New Issue
Block a user