diff options
Diffstat (limited to 'data.c')
| -rw-r--r-- | data.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -3650,3 +3650,19 @@ t_announcement *announcement(const double after) return NULL; } + + +xs_str *make_url(const char *href, const char *proxy) +/* makes an URL, possibly including proxying */ +{ + xs_str *url = NULL; + + if (proxy && !xs_startswith(href, srv_baseurl)) { + xs *p = xs_str_cat(xs_dup(proxy), "/proxy/"); + url = xs_replace(href, "https:/" "/", p); + } + else + url = xs_dup(href); + + return url; +} |