mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-12-25 08:53:36 +00:00
New variable USER_AGENT.
This commit is contained in:
parent
5784ddecb4
commit
f1dbd8e700
4 changed files with 7 additions and 3 deletions
2
data.c
2
data.c
|
@ -545,7 +545,7 @@ int timeline_add(snac *snac, char *id, char *o_msg, char *parent, char *referrer
|
|||
"\"children\": [],"
|
||||
"\"liked_by\": [],"
|
||||
"\"announced_by\": [],"
|
||||
"\"version\": \"snac/2.x\","
|
||||
"\"version\": \"" USER_AGENT "\","
|
||||
"\"referrer\": null,"
|
||||
"\"parent\": null"
|
||||
"}");
|
||||
|
|
2
http.c
2
http.c
|
@ -90,7 +90,7 @@ d_char *http_signed_request(snac *snac, char *method, char *url,
|
|||
hdrs = xs_dict_append(hdrs, "signature", signature);
|
||||
hdrs = xs_dict_append(hdrs, "digest", digest);
|
||||
hdrs = xs_dict_append(hdrs, "host", host);
|
||||
hdrs = xs_dict_append(hdrs, "user-agent", "snac/2.x");
|
||||
hdrs = xs_dict_append(hdrs, "user-agent", USER_AGENT);
|
||||
|
||||
response = xs_http_request(method, url, hdrs,
|
||||
body, b_size, status, payload, p_size);
|
||||
|
|
2
httpd.c
2
httpd.c
|
@ -158,7 +158,7 @@ void httpd_connection(int rs)
|
|||
ctype = "text/html; charset=utf-8";
|
||||
|
||||
headers = xs_dict_append(headers, "content-type", ctype);
|
||||
headers = xs_dict_append(headers, "x-creator", "snac/2.x");
|
||||
headers = xs_dict_append(headers, "x-creator", USER_AGENT);
|
||||
|
||||
if (b_size == 0 && body != NULL)
|
||||
b_size = strlen(body);
|
||||
|
|
4
snac.h
4
snac.h
|
@ -1,6 +1,10 @@
|
|||
/* snac - A simple, minimalistic ActivityPub instance */
|
||||
/* copyright (c) 2022 grunfink - MIT license */
|
||||
|
||||
#define VERSION "2.0001"
|
||||
|
||||
#define USER_AGENT "snac/" VERSION
|
||||
|
||||
extern d_char *srv_basedir;
|
||||
extern d_char *srv_config;
|
||||
extern d_char *srv_baseurl;
|
||||
|
|
Loading…
Reference in a new issue