aboutsummaryrefslogtreecommitdiff
path: root/httpd.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2025-01-02 07:11:58 +0100
committerdefault <nobody@localhost>2025-01-02 07:11:58 +0100
commit00079323ccad162d55c0b1f7d25eddf3ea4c1e45 (patch)
tree0af63edc2ac4780481d0d0246ab6290e9496597f /httpd.c
parent4b87557048af170a5f0e2abb7940e01def09f2ff (diff)
Minor tweak to the /share webpoint.
Diffstat (limited to 'httpd.c')
-rw-r--r--httpd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/httpd.c b/httpd.c
index 3d0d110..d796f25 100644
--- a/httpd.c
+++ b/httpd.c
@@ -281,8 +281,12 @@ int server_get_handler(xs_dict *req, const char *q_path,
const char *text = xs_dict_get(q_vars, "text");
xs *s = NULL;
- if (xs_type(text) == XSTYPE_STRING)
- s = xs_fmt("%s:\n\n%s\n", text, url);
+ if (xs_type(text) == XSTYPE_STRING) {
+ if (xs_type(url) == XSTYPE_STRING)
+ s = xs_fmt("%s:\n\n%s\n", text, url);
+ else
+ s = xs_fmt("%s\n", text);
+ }
else
s = xs_fmt("%s\n", url);