Add CSRF protection.
This commit is contained in:
parent
8e47c74b68
commit
0910b16e1e
5 changed files with 68 additions and 7 deletions
|
@ -17,7 +17,7 @@ import debugname from 'debug';
|
|||
const debug = debugname('hostr-web');
|
||||
|
||||
const router = new Router();
|
||||
router.use(errors({template: path.join(__dirname, 'public', '404.html')}));
|
||||
router.use(errors({template: path.join(__dirname, 'public', 'error.html')}));
|
||||
|
||||
let statsdOpts = {prefix: 'hostr-web', host: process.env.STATSD_HOST || 'localhost'};
|
||||
router.use(stats(statsdOpts));
|
||||
|
@ -39,6 +39,8 @@ router.use(function* (next) {
|
|||
yield next;
|
||||
});
|
||||
|
||||
router.use(csrf());
|
||||
|
||||
router.use(views('views', {
|
||||
default: 'ejs'
|
||||
}));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue