]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Merge pull request #3754 from rgacogne/dnsdist-custom-headers
authorbert hubert <bert.hubert@netherlabs.nl>
Fri, 29 Apr 2016 11:13:17 +0000 (13:13 +0200)
committerbert hubert <bert.hubert@netherlabs.nl>
Fri, 29 Apr 2016 11:13:17 +0000 (13:13 +0200)
dnsdist: Allow the use of custom headers in the web server

1  2 
pdns/README-dnsdist.md
pdns/dnsdist-lua.cc
pdns/dnsdist-web.cc
pdns/dnsdist.hh

Simple merge
Simple merge
index 4ebda9cfa72f4d08b06c3afb59c7102488664884,45143573178f3f188d64fd9f8f046258933e2fb9..52f1719616bc94008b0a2e7994d69f06aab3d9ee
@@@ -87,14 -120,12 +120,13 @@@ static void connectionThread(int sock, 
  
      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");
  
diff --cc pdns/dnsdist.hh
Simple merge