summaryrefslogtreecommitdiff
path: root/http.c
diff options
context:
space:
mode:
authorGravatar default2023-03-02 17:28:29 +0100
committerGravatar default2023-03-02 17:28:29 +0100
commitaaf6ff20c1d93dcb4b055deff333e0d9bd705830 (patch)
tree4d9382c6651cebd4902bbe6c05ef5ff5c1ab22b6 /http.c
parentAdded the url to srv_archive(). (diff)
downloadpenes-snac2-aaf6ff20c1d93dcb4b055deff333e0d9bd705830.tar.gz
penes-snac2-aaf6ff20c1d93dcb4b055deff333e0d9bd705830.tar.xz
penes-snac2-aaf6ff20c1d93dcb4b055deff333e0d9bd705830.zip
Add the baseurl to the user agent in the signed GET.
Diffstat (limited to 'http.c')
-rw-r--r--http.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/http.c b/http.c
index dba47a4..ae46001 100644
--- a/http.c
+++ b/http.c
@@ -87,11 +87,13 @@ xs_dict *http_signed_request_raw(const char *keyid, const char *seckey,
87 else 87 else
88 hdrs = xs_dict_append(hdrs, "accept", "application/activity+json"); 88 hdrs = xs_dict_append(hdrs, "accept", "application/activity+json");
89 89
90 xs *user_agent = xs_fmt("%s; +%s/", USER_AGENT, srv_baseurl);
91
90 hdrs = xs_dict_append(hdrs, "date", date); 92 hdrs = xs_dict_append(hdrs, "date", date);
91 hdrs = xs_dict_append(hdrs, "signature", signature); 93 hdrs = xs_dict_append(hdrs, "signature", signature);
92 hdrs = xs_dict_append(hdrs, "digest", digest); 94 hdrs = xs_dict_append(hdrs, "digest", digest);
93 hdrs = xs_dict_append(hdrs, "host", host); 95 hdrs = xs_dict_append(hdrs, "host", host);
94 hdrs = xs_dict_append(hdrs, "user-agent", USER_AGENT); 96 hdrs = xs_dict_append(hdrs, "user-agent", user_agent);
95 97
96 response = xs_http_request(method, url, hdrs, 98 response = xs_http_request(method, url, hdrs,
97 body, b_size, status, payload, p_size, timeout); 99 body, b_size, status, payload, p_size, timeout);