commit 7f2be13

default  ·  2025-01-02 06:27:48 +0000 UTC
parent 0007932
Serve BASE_URL/style.css.

I thought I was already doing this 🤦(not that it really matters much).
1 files changed,  +13, -0
+13, -0
 1@@ -275,6 +275,19 @@ int server_get_handler(xs_dict *req, const char *q_path,
 2                             "Disallow: /\n");
 3     }
 4     else
 5+    if (strcmp(q_path, "/style.css") == 0) {
 6+        FILE *f;
 7+        xs *css_fn = xs_fmt("%s/style.css", srv_basedir);
 8+
 9+        if ((f = fopen(css_fn, "r")) != NULL) {
10+            *body = xs_readall(f);
11+            fclose(f);
12+
13+            status = HTTP_STATUS_OK;
14+            *ctype = "text/css";
15+        }
16+    }
17+    else
18     if (strcmp(q_path, "/share") == 0) {
19         const xs_dict *q_vars = xs_dict_get(req, "q_vars");
20         const char *url  = xs_dict_get(q_vars, "url");