mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-15 01:55:03 +00:00
Add the baseurl to the user agent in the signed GET.
This commit is contained in:
parent
b2ce9323db
commit
aaf6ff20c1
1 changed files with 3 additions and 1 deletions
4
http.c
4
http.c
|
@ -87,11 +87,13 @@ xs_dict *http_signed_request_raw(const char *keyid, const char *seckey,
|
||||||
else
|
else
|
||||||
hdrs = xs_dict_append(hdrs, "accept", "application/activity+json");
|
hdrs = xs_dict_append(hdrs, "accept", "application/activity+json");
|
||||||
|
|
||||||
|
xs *user_agent = xs_fmt("%s; +%s/", USER_AGENT, srv_baseurl);
|
||||||
|
|
||||||
hdrs = xs_dict_append(hdrs, "date", date);
|
hdrs = xs_dict_append(hdrs, "date", date);
|
||||||
hdrs = xs_dict_append(hdrs, "signature", signature);
|
hdrs = xs_dict_append(hdrs, "signature", signature);
|
||||||
hdrs = xs_dict_append(hdrs, "digest", digest);
|
hdrs = xs_dict_append(hdrs, "digest", digest);
|
||||||
hdrs = xs_dict_append(hdrs, "host", host);
|
hdrs = xs_dict_append(hdrs, "host", host);
|
||||||
hdrs = xs_dict_append(hdrs, "user-agent", USER_AGENT);
|
hdrs = xs_dict_append(hdrs, "user-agent", user_agent);
|
||||||
|
|
||||||
response = xs_http_request(method, url, hdrs,
|
response = xs_http_request(method, url, hdrs,
|
||||||
body, b_size, status, payload, p_size, timeout);
|
body, b_size, status, payload, p_size, timeout);
|
||||||
|
|
Loading…
Reference in a new issue