Browse Source

Minor fixes of web server

pull/6/head
Menci 6 years ago
parent
commit
5dd985fea1
  1. 6
      app.js

6
app.js

@ -53,7 +53,7 @@ global.syzoj = {
}); });
// Set assets dir // Set assets dir
app.use(Express.static(__dirname + '/static')); app.use(Express.static(__dirname + '/static', { maxage: '1y' }));
// Set template engine ejs // Set template engine ejs
app.set('view engine', 'ejs'); app.set('view engine', 'ejs');
@ -171,7 +171,7 @@ global.syzoj = {
let FileStore = require('session-file-store')(Session); let FileStore = require('session-file-store')(Session);
let sessionConfig = { let sessionConfig = {
secret: this.config.session_secret, secret: this.config.session_secret,
cookie: {}, cookie: { httpOnly: false },
rolling: true, rolling: true,
saveUninitialized: true, saveUninitialized: true,
resave: true, resave: true,
@ -179,7 +179,7 @@ global.syzoj = {
}; };
if (syzoj.production) { if (syzoj.production) {
app.set('trust proxy', 1); app.set('trust proxy', 1);
sessionConfig.cookie.secure = true; sessionConfig.cookie.secure = false;
} }
app.use(Session(sessionConfig)); app.use(Session(sessionConfig));

Loading…
Cancel
Save