Skip to content

Commit 85b6f36

Browse files
committed
use helmet
1 parent 8c7ee80 commit 85b6f36

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"dat.gui": "^0.7.7",
2020
"express": "^4.17.1",
2121
"flying-squid": "^1.4.0",
22+
"helmet": "^4.4.1",
2223
"html-webpack-plugin": "^4.5.1",
2324
"http": "0.0.1-security",
2425
"https": "^1.0.0",

src/index.coffee

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@ module.exports=(mode)->
1010
vec3=require "vec3"
1111
Convert = require "ansi-to-html"
1212
convert = new Convert()
13+
helmet = require "helmet"
1314

1415
sf={}
1516
socketInfo={}
1617
port=process.env.PORT or 8080
1718

18-
app.use (req, res, next)->
19-
res.setHeader 'Content-Security-Policy', 'worker-src *'
20-
next()
21-
return
19+
app.use helmet()
2220

2321
if mode is "production"
2422
app.use express.static "#{__dirname}/client/dist"

0 commit comments

Comments
 (0)