mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-25 18:50:26 +00:00
chore(server.js): Add CSP support
The support is disabled by default, uncomment relevant lines to enable it.
This commit is contained in:
parent
73caf76225
commit
2b1b257034
1 changed files with 3 additions and 0 deletions
|
|
@ -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'
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue