diff options
author | default <nobody@localhost> | 2023-06-13 20:36:43 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2023-06-13 20:36:43 +0200 |
commit | e0c6fb786c3b72b8a789041db2909fa7d1d880de (patch) | |
tree | 40b4b9af3f6de66ffe5cf839a5e603963344a4bd /webfinger.c | |
parent | e26d05746c8ad2ea79931f8be24536e6f8ce59a7 (diff) |
New function webfinger_request_signed().
Diffstat (limited to 'webfinger.c')
-rw-r--r-- | webfinger.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/webfinger.c b/webfinger.c index ca4ed71..a167cd0 100644 --- a/webfinger.c +++ b/webfinger.c @@ -7,7 +7,7 @@ #include "snac.h" -int webfinger_request(const char *qs, char **actor, char **user) +int webfinger_request_signed(snac *snac, const char *qs, char **actor, char **user) /* queries the webfinger for qs and fills the required fields */ { int status; @@ -61,7 +61,10 @@ int webfinger_request(const char *qs, char **actor, char **user) else { xs *url = xs_fmt("https:/" "/%s/.well-known/webfinger?resource=%s", host, resource); - xs_http_request("GET", url, headers, NULL, 0, &status, &payload, &p_size, 0); + if (snac == NULL) + xs_http_request("GET", url, headers, NULL, 0, &status, &payload, &p_size, 0); + else + http_signed_request(snac, "GET", url, headers, NULL, 0, &status, &payload, &p_size, 0); } if (valid_status(status)) { @@ -96,6 +99,13 @@ int webfinger_request(const char *qs, char **actor, char **user) } +int webfinger_request(const char *qs, char **actor, char **user) +/* queries the webfinger for qs and fills the required fields */ +{ + return webfinger_request_signed(NULL, qs, actor, user); +} + + int webfinger_get_handler(d_char *req, char *q_path, char **body, int *b_size, char **ctype) /* serves webfinger queries */ |