summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-04-18 17:13:31 +0200
committerdefault <nobody@localhost>2024-04-18 17:13:31 +0200
commit26840e0dc0e7322b2041c21b4e44ed9a34afff4b (patch)
tree096c8e9c65df453f5e45bfde8ca8662b9a82c899 /data.c
parent100c9cf569ef4497160ac60a55f5b94b9cb524bc (diff)
Some tweaks to previous patch.
Diffstat (limited to 'data.c')
-rw-r--r--data.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/data.c b/data.c
index d3045f4..1e46395 100644
--- a/data.c
+++ b/data.c
@@ -60,15 +60,17 @@ int srv_open(char *basedir, int auto_upgrade)
char *host;
char *prefix;
char *dbglvl;
+ char *proto;
host = xs_dict_get(srv_config, "host");
prefix = xs_dict_get(srv_config, "prefix");
dbglvl = xs_dict_get(srv_config, "dbglevel");
+ proto = xs_dict_get_def(srv_config, "protocol", "https");
if (host == NULL || prefix == NULL)
error = xs_str_new("ERROR: cannot get server data");
else {
- srv_baseurl = xs_fmt("http://%s%s", host, prefix);
+ srv_baseurl = xs_fmt("%s:/" "/%s%s", proto, host, prefix);
dbglevel = (int) xs_number_get(dbglvl);
@@ -1990,7 +1992,7 @@ xs_list *inbox_list(void)
xs_str *_instance_block_fn(const char *instance)
{
- xs *s = xs_replace(instance, "http:/" "/", "");
+ xs *s = xs_replace(instance, "http:/" "/", "");
xs *s1 = xs_replace(s, "https:/" "/", "");
xs *l = xs_split(s1, "/");
char *p = xs_list_get(l, 0);