add HSTS header

This commit is contained in:
AJ ONeal 2015-09-25 08:06:47 +00:00
parent c6034b3992
commit 3de6e4843d
2 changed files with 3 additions and 0 deletions

View File

@ -6,6 +6,8 @@ module.exports.create = function (securePort, insecurePort, redirects) {
var escapeRe; var escapeRe;
function redirectHttps(req, res) { function redirectHttps(req, res) {
res.setHeader('Strict-Transport-Security', 'max-age=10886400; includeSubDomains; preload');
var insecureRedirects; var insecureRedirects;
var host = req.headers.host || ''; var host = req.headers.host || '';
var url = req.url; var url = req.url;

View File

@ -132,6 +132,7 @@ module.exports.create = function (securePort, certsPath, vhostsdir) {
console.log('[log] [once] Preparing mount for', domaininfo.hostname + '/' + domaininfo.dirpathname); console.log('[log] [once] Preparing mount for', domaininfo.hostname + '/' + domaininfo.dirpathname);
domainMergeMap[domaininfo.hostname].mountsMap['/' + domaininfo.dirpathname] = function (req, res, next) { domainMergeMap[domaininfo.hostname].mountsMap['/' + domaininfo.dirpathname] = function (req, res, next) {
res.setHeader('Strict-Transport-Security', 'max-age=10886400; includeSubDomains; preload');
function loadThatApp() { function loadThatApp() {
var time = Date.now(); var time = Date.now();