chore(server.js): Add CSP support

The support is disabled by default, uncomment relevant lines to enable
it.
This commit is contained in:
Igor Minar 2012-04-27 15:20:34 -07:00
parent 73caf76225
commit 2b1b257034

View file

@ -190,6 +190,9 @@ StaticServlet.prototype.sendFile_ = function(req, res, path) {
var self = this;
var file = fs.createReadStream(path);
res.writeHead(200, {
// CSP headers, uncomment to enable CSP
//"X-WebKit-CSP": "default-src 'self';",
//"X-Content-Security-Policy": "default-src 'self'",
'Content-Type': StaticServlet.
MimeMap[path.split('.').pop()] || 'text/plain'
});