Skip to content

Commit d69d65e

Browse files
committed
Updated to send hsts in https header
1 parent f889ffa commit d69d65e

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

app.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ var imgur = require('imgur');
1717
var formidable = require('formidable');
1818
var morgan = require('morgan');
1919
var passportSocketIo = require("passport.socketio");
20+
var helmet = require('helmet');
2021

2122
//core
2223
var config = require("./config.js");
@@ -92,6 +93,13 @@ var sessionStore = new MongoStore({
9293
//compression
9394
app.use(compression());
9495

96+
// use hsts to tell https users stick to this
97+
app.use(helmet.hsts({
98+
maxAge: 31536000 * 1000, // 365 days
99+
includeSubdomains: true,
100+
preload: true
101+
}));
102+
95103
//session
96104
app.use(session({
97105
name: config.sessionname,

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"express-session": "^1.13.0",
2323
"formidable": "^1.0.17",
2424
"highlight.js": "^9.1.0",
25+
"helmet": "^1.3.0",
2526
"imgur": "^0.1.7",
2627
"jsdom-nogyp": "^0.8.3",
2728
"kerberos": "0.0.17",

0 commit comments

Comments
 (0)