req.getvars.erase("_"); // jQuery cache buster
- YaHTTP::Response resp(req);
+ YaHTTP::Response resp;
+ resp.version = req.version;
const string charset = "; charset=utf-8";
- resp.headers["X-Content-Type-Options"] = "nosniff";
- resp.headers["X-Frame-Options"] = "deny";
- resp.headers["X-Permitted-Cross-Domain-Policies"] = "none";
- resp.headers["X-XSS-Protection"] = "1; mode=block";
- resp.headers["Content-Security-Policy"] = "default-src 'self'; style-src 'self' 'unsafe-inline'";
+
+ addCustomHeaders(resp, customHeaders);
+ addSecurityHeaders(resp, customHeaders);
+
/* no need to send back the API key if any */
resp.headers.erase("X-API-Key");