Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
chore(server.js): Add CSP support
Browse files Browse the repository at this point in the history
The support is disabled by default, uncomment relevant lines to enable
it.
  • Loading branch information
IgorMinar committed Apr 28, 2012
1 parent 73caf76 commit 2b1b257
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/nodeserver/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
});
Expand Down

0 comments on commit 2b1b257

Please sign in to comment.