From 39aaad2255fa31886975b2eb3c5fa8f54e05344f Mon Sep 17 00:00:00 2001 From: laughn-man Date: Tue, 7 Oct 2014 14:45:24 -0400 Subject: [PATCH] Resolve theme issues with https behind reverse proxy Resolving 2 issues by changing the protocol to //. When terminating https at the ACE level the HTTPS field is false resulting in http requests for css on an https site. Requesting the Roboto Slab font always goes over http. This is a problem for browsers when the site is hosted over https. --- libs/daux.php | 6 ++---- themes/daux-blue.thm | 2 +- themes/daux-green.thm | 2 +- themes/daux-navy.thm | 2 +- themes/daux-red.thm | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/libs/daux.php b/libs/daux.php index a1952a1..b22d523 100644 --- a/libs/daux.php +++ b/libs/daux.php @@ -198,8 +198,7 @@ $params['error_type'] = ErrorPage::NORMAL_ERROR_TYPE; $params['index_key'] = 'index'; $params['docs_path'] = $this->docs_path; - $protocol = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443) ? - 'https://' : 'http://'; + $protocol = '//'; $params['base_url'] = $protocol . $this->base_url . '/'; $params['base_page'] = $params['base_url']; $params['host'] = $this->host; @@ -228,8 +227,7 @@ case Daux::LIVE_MODE: $params['docs_path'] = $this->docs_path; $params['index_key'] = 'index'; - $protocol = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443) ? - 'https://' : 'http://'; + $protocol = '//'; $params['base_url'] = $protocol . $this->base_url . '/'; $params['base_page'] = $params['base_url']; $params['host'] = $this->host; diff --git a/themes/daux-blue.thm b/themes/daux-blue.thm index cd61bae..10fc3fe 100644 --- a/themes/daux-blue.thm +++ b/themes/daux-blue.thm @@ -1,7 +1,7 @@ { "favicon": "themes/daux-blue/img/favicon-blue.png", "css": ["themes/daux-blue/css/daux-blue.css"], - "fonts": ["http://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700&subset=latin,cyrillic-ext,cyrillic"], + "fonts": ["//fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700&subset=latin,cyrillic-ext,cyrillic"], "js": [], "require-jquery": true, "bootstrap-js": false diff --git a/themes/daux-green.thm b/themes/daux-green.thm index a2a47de..b679f0c 100644 --- a/themes/daux-green.thm +++ b/themes/daux-green.thm @@ -1,7 +1,7 @@ { "favicon": "themes/daux-green/img/favicon-green.png", "css": ["themes/daux-green/css/daux-green.css"], - "fonts": ["http://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700&subset=latin,cyrillic-ext,cyrillic"], + "fonts": ["//fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700&subset=latin,cyrillic-ext,cyrillic"], "js": [], "require-jquery": true, "bootstrap-js": false diff --git a/themes/daux-navy.thm b/themes/daux-navy.thm index 36488c9..aecc385 100644 --- a/themes/daux-navy.thm +++ b/themes/daux-navy.thm @@ -1,7 +1,7 @@ { "favicon": "themes/daux-navy/img/favicon-navy.png", "css": ["themes/daux-navy/css/daux-navy.css"], - "fonts": ["http://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700&subset=latin,cyrillic-ext,cyrillic"], + "fonts": ["//fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700&subset=latin,cyrillic-ext,cyrillic"], "js": [], "require-jquery": true, "bootstrap-js": false diff --git a/themes/daux-red.thm b/themes/daux-red.thm index df89b67..1cbb8ad 100644 --- a/themes/daux-red.thm +++ b/themes/daux-red.thm @@ -1,7 +1,7 @@ { "favicon": "themes/daux-red/img/favicon-red.png", "css": ["themes/daux-red/css/daux-red.css"], - "fonts": ["http://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700&subset=latin,cyrillic-ext,cyrillic"], + "fonts": ["//fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700&subset=latin,cyrillic-ext,cyrillic"], "js": [], "require-jquery": true, "bootstrap-js": false