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

Commit 2b1b257

Browse files
committed
chore(server.js): Add CSP support
The support is disabled by default, uncomment relevant lines to enable it.
1 parent 73caf76 commit 2b1b257

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/nodeserver/server.js

+3
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ StaticServlet.prototype.sendFile_ = function(req, res, path) {
190190
var self = this;
191191
var file = fs.createReadStream(path);
192192
res.writeHead(200, {
193+
// CSP headers, uncomment to enable CSP
194+
//"X-WebKit-CSP": "default-src 'self';",
195+
//"X-Content-Security-Policy": "default-src 'self'",
193196
'Content-Type': StaticServlet.
194197
MimeMap[path.split('.').pop()] || 'text/plain'
195198
});

0 commit comments

Comments
 (0)