diff options
| author | default <nobody@localhost> | 2024-11-07 22:00:25 +0100 |
|---|---|---|
| committer | default <nobody@localhost> | 2024-11-07 22:00:25 +0100 |
| commit | c7e8f3783bd77e22755f958faa0cff03424f00ef (patch) | |
| tree | d65cf0236d7a1da701e8163c29294702b094d6c7 /data.c | |
| parent | 34dbddb2b54060a9e9398447faf4399ba2484d41 (diff) | |
Moved make_url() to data.c.
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; +} |