UNPKG

keystone

Version:

Web Application Framework and Admin GUI / Content Management System built on Express.js and Mongoose

23 lines (21 loc) 450 B
/** * Adds iframe protection headers to the response * * ####Example: * * app.use(keystone.security.frameGuard(keystone)); * * @param {app.request} req * @param {app.response} res * @param {function} next * @api public */ module.exports = function (keystone) { return function frameGuard (req, res, next) { var options = keystone.get('frame guard'); if (options) { res.header('x-frame-options', options); } next(); }; };