Rename HTTPS env vars

This commit is contained in:
Tankred Hase
2016-06-10 19:42:00 +02:00
parent 7a8600ae9c
commit 7ae7c6da87
4 changed files with 11 additions and 11 deletions

View File

@@ -75,7 +75,7 @@ router.get('/', home);
// Redirect all http traffic to https
app.use(function *(next) {
if (util.isTrue(config.server.upgradeHTTPS) && util.checkHTTP(this)) {
if (util.isTrue(config.server.httpsUpgrade) && util.checkHTTP(this)) {
this.redirect('https://' + this.hostname + this.url);
} else {
yield next;
@@ -84,11 +84,11 @@ app.use(function *(next) {
// Set HTTP response headers
app.use(function *(next) {
if (util.isTrue(config.server.upgradeHTTPS)) {
if (util.isTrue(config.server.httpsUpgrade)) {
this.set('Strict-Transport-Security', 'max-age=16070400');
}
if (config.server.publicKeyPin && config.server.publicKeyPinBackup) {
this.set('Public-Key-Pins', 'pin-sha256="' + config.server.publicKeyPin + '"; pin-sha256="' + config.server.publicKeyPinBackup + '"; max-age=16070400');
if (config.server.httpsKeyPin && config.server.httpsKeyPinBackup) {
this.set('Public-Key-Pins', 'pin-sha256="' + config.server.httpsKeyPin + '"; pin-sha256="' + config.server.httpsKeyPinBackup + '"; max-age=16070400');
}
this.set('Access-Control-Allow-Origin', '*');
this.set('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');