string command=req.getvars["command"];
- string callback;
-
- if(req.getvars.count("callback")) {
- callback=req.getvars["callback"];
- req.getvars.erase("callback");
- }
-
req.getvars.erase("_"); // jQuery cache buster
YaHTTP::Response resp(req);
+ 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'; img-src *; style-src 'self' 'unsafe-inline'";
if (!compareAuthorization(req, password)) {
errlog("HTTP Request \"%s\" from %s: Web Authentication failed", req.url.path, remote.toStringWithPort());
resp.status=404;
}
- if(!callback.empty()) {
- resp.body = callback + "(" + resp.body + ");";
- }
-
std::ostringstream ofs;
ofs << resp;
string done;
$.ajax({
url: 'jsonstat?command=stats',
type: 'GET',
- dataType: 'jsonp',
+ jsonp: false,
success: function(data, x, y) {
$("#questions").text(data["queries"]);
$("#acl-drops").text(data["acl-drops"]);