diff options
| author | 2025-05-21 21:11:47 +0200 | |
|---|---|---|
| committer | 2025-05-21 21:11:47 +0200 | |
| commit | 979718e3cc5489efdce2acc6f8c86f6d00bb91c7 (patch) | |
| tree | 7b4936bdb5ea07c7dd617d508c487d70020f0146 /httpd.c | |
| parent | po/de_DE.po aktualisiert (diff) | |
| parent | Merge pull request 'make greetings theme adaptive; define style in header' (#... (diff) | |
| download | snac2-979718e3cc5489efdce2acc6f8c86f6d00bb91c7.tar.gz snac2-979718e3cc5489efdce2acc6f8c86f6d00bb91c7.tar.xz snac2-979718e3cc5489efdce2acc6f8c86f6d00bb91c7.zip | |
Merge pull request 'master refresh' (#8) from grunfink/snac2:master into master
Reviewed-on: https://codeberg.org/zen/snac2/pulls/8
Diffstat (limited to 'httpd.c')
| -rw-r--r-- | httpd.c | 5 |
1 files changed, 4 insertions, 1 deletions
| @@ -139,6 +139,8 @@ static xs_str *greeting_html(void) | |||
| 139 | snac user; | 139 | snac user; |
| 140 | 140 | ||
| 141 | if (strcmp(uid, "relay") && user_open(&user, uid)) { | 141 | if (strcmp(uid, "relay") && user_open(&user, uid)) { |
| 142 | xs *formatted_name = format_text_with_emoji(NULL, xs_dict_get(user.config, "name"), 1, NULL); | ||
| 143 | |||
| 142 | xs_html_add(ul, | 144 | xs_html_add(ul, |
| 143 | xs_html_tag("li", | 145 | xs_html_tag("li", |
| 144 | xs_html_tag("a", | 146 | xs_html_tag("a", |
| @@ -148,7 +150,7 @@ static xs_str *greeting_html(void) | |||
| 148 | xs_html_text("@"), | 150 | xs_html_text("@"), |
| 149 | xs_html_text(host), | 151 | xs_html_text(host), |
| 150 | xs_html_text(" ("), | 152 | xs_html_text(" ("), |
| 151 | xs_html_text(xs_dict_get(user.config, "name")), | 153 | xs_html_raw(formatted_name), |
| 152 | xs_html_text(")")))); | 154 | xs_html_text(")")))); |
| 153 | 155 | ||
| 154 | user_free(&user); | 156 | user_free(&user); |
| @@ -554,6 +556,7 @@ void httpd_connection(FILE *f) | |||
| 554 | 556 | ||
| 555 | headers = xs_dict_append(headers, "access-control-allow-origin", "*"); | 557 | headers = xs_dict_append(headers, "access-control-allow-origin", "*"); |
| 556 | headers = xs_dict_append(headers, "access-control-allow-headers", "*"); | 558 | headers = xs_dict_append(headers, "access-control-allow-headers", "*"); |
| 559 | headers = xs_dict_append(headers, "access-control-expose-headers", "Link"); | ||
| 557 | 560 | ||
| 558 | /* disable any form of fucking JavaScript */ | 561 | /* disable any form of fucking JavaScript */ |
| 559 | headers = xs_dict_append(headers, "Content-Security-Policy", "script-src ;"); | 562 | headers = xs_dict_append(headers, "Content-Security-Policy", "script-src ;"); |