add HSTS header
This commit is contained in:
		
							parent
							
								
									c6034b3992
								
							
						
					
					
						commit
						3de6e4843d
					
				@ -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;
 | 
				
			||||||
 | 
				
			|||||||
@ -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();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user