From ffe7e65db64a92abb193ae161bec121c51a0298b Mon Sep 17 00:00:00 2001 From: John McLear Date: Thu, 14 Mar 2013 19:03:20 -0300 Subject: [PATCH] allow strict transport if ssl is on and stop x-frame-options, this might break embedded pads, please test --- src/node/hooks/express.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/node/hooks/express.js b/src/node/hooks/express.js index 34baca40..7e9546c2 100644 --- a/src/node/hooks/express.js +++ b/src/node/hooks/express.js @@ -27,7 +27,7 @@ exports.createServer = function () { } console.log("Report bugs at https://github.com/ether/etherpad-lite/issues") - serverName = "Etherpad-Lite " + version + " (http://etherpad.org)"; + serverName = "Etherpad " + version + " (http://etherpad.org)"; exports.restartServer(); @@ -71,6 +71,11 @@ exports.restartServer = function () { } app.use(function (req, res, next) { + res.header("X-Frame-Options", "deny"); + if(settings.ssl){ // if we use SSL + res.header("X-Frame-Options", "max-age=31536000; includeSubDomains"); + } + res.header("Server", serverName); next(); });