summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/snac.84
-rw-r--r--httpd.c3
2 files changed, 4 insertions, 3 deletions
diff --git a/doc/snac.8 b/doc/snac.8
index c0a110c..7a7352c 100644
--- a/doc/snac.8
+++ b/doc/snac.8
@@ -198,9 +198,7 @@ By setting this to true, no inbox collection is done. Inbox collection helps
198being discovered from remote instances, but also increases network traffic. 198being discovered from remote instances, but also increases network traffic.
199.It Ic http_headers 199.It Ic http_headers
200If you need to add more HTTP response headers for whatever reason, you can 200If you need to add more HTTP response headers for whatever reason, you can
201fill this object with the required header/value pairs. For example, for enhanced 201fill this object with the required header/value pairs.
202XSS security, you can set the "Content-Security-Policy" header to "script-src ;"
203to be totally sure that no JavaScript is executed.
204.It Ic show_instance_timeline 202.It Ic show_instance_timeline
205If this is set to true, the instance base URL will show a timeline with the latest 203If this is set to true, the instance base URL will show a timeline with the latest
206user posts instead of the default greeting static page. If other information 204user posts instead of the default greeting static page. If other information
diff --git a/httpd.c b/httpd.c
index 5a38aff..d22bb14 100644
--- a/httpd.c
+++ b/httpd.c
@@ -553,6 +553,9 @@ void httpd_connection(FILE *f)
553 headers = xs_dict_append(headers, "access-control-allow-origin", "*"); 553 headers = xs_dict_append(headers, "access-control-allow-origin", "*");
554 headers = xs_dict_append(headers, "access-control-allow-headers", "*"); 554 headers = xs_dict_append(headers, "access-control-allow-headers", "*");
555 555
556 /* disable any form of fucking JavaScript */
557 headers = xs_dict_append(headers, "Content-Security-Policy", "script-src ;");
558
556 if (p_state->use_fcgi) 559 if (p_state->use_fcgi)
557 xs_fcgi_response(f, status, headers, body, b_size, fcgi_id); 560 xs_fcgi_response(f, status, headers, body, b_size, fcgi_id);
558 else 561 else