{ "X-Permitted-Cross-Domain-Policies", "none" },
{ "X-XSS-Protection", "1; mode=block" },
{ "Content-Security-Policy", "default-src 'self'; style-src 'self' 'unsafe-inline'" },
- { "Connection", "close" },
};
for (const auto& h : headers) {
addCustomHeaders(resp, customHeaders);
addSecurityHeaders(resp, customHeaders);
+ /* indicate that the connection will be closed after completion of the response */
+ resp.headers["Connection"] = "close";
/* no need to send back the API key if any */
resp.headers.erase("X-API-Key");
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 1; mode=block
Content-Security-Policy: default-src 'self'; style-src 'self' 'unsafe-inline'
- Connection: close
You can override those headers, or add custom headers by using the last parameter to :func:`webserver`.
For example, to remove the X-Frame-Options header and add a X-Custom one: