Skip to content

Commit

Permalink
Restart FTL on change of webserver.headers
Browse files Browse the repository at this point in the history
Signed-off-by: DL6ER <[email protected]>
  • Loading branch information
DL6ER committed Feb 22, 2025
1 parent bc6104e commit a53a357
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/config/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,7 @@ static void initConfig(struct config *conf)
conf->webserver.headers.h = "Additional HTTP headers added to the web server responses.\n The headers are separated by a carriage return and a line feed (\\r\\n). The headers are added to all responses, including those for the API.\n Note about the default additional headers:\n - Content-Security-Policy: [...] 'unsafe-inline' is both required by Chart.js styling some elements directly, and index.html containing some inlined Javascript code.\n - X-Frame-Options: DENY: The page can not be displayed in a frame, regardless of the site attempting to do so.\n - X-Xss-Protection: 0: Disables XSS filtering in browsers that support it. This header is usually enabled by default in browsers, and is not recommended as it can hurt the security of the site. (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection).\n - X-Content-Type-Options: nosniff: Marker used by the server to indicate that the MIME types advertised in the Content-Type headers should not be changed and be followed. This allows to opt-out of MIME type sniffing, or, in other words, it is a way to say that the webmasters knew what they were doing. Site security testers usually expect this header to be set.\n - Referrer-Policy: strict-origin-when-cross-origin: A referrer will be sent for same-site origins, but cross-origin requests will send no referrer information.\n The latter four headers are set as expected by https://securityheaders.io";
conf->webserver.headers.a = cJSON_CreateStringReference("<valid HTTP headers>");
conf->webserver.headers.t = CONF_STRING;
conf->webserver.headers.f = FLAG_RESTART_FTL;
conf->webserver.headers.d.s = (char*)"Content-Security-Policy: default-src 'self' 'unsafe-inline';\r\nX-Frame-Options: DENY\r\nX-XSS-Protection: 0\r\nX-Content-Type-Options: nosniff\r\nReferrer-Policy: strict-origin-when-cross-origin";
conf->webserver.headers.c = validate_stub; // Only type-based checking

Expand Down

0 comments on commit a53a357

Please sign in to comment.