Skip to content

Commit d74d287

Browse files
committed
Removed support for mixed http/https mode
refs: TryGhost/Ghost#14446 - currently ghost will upgrade configured urls to https if a secure request comes into a http configured site - we no longer want to support this feature - instead, ghost will strictly honour the configured URL
1 parent 35d11a7 commit d74d287

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

packages/config-url-helpers/lib/config-url-helpers.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,11 @@ function getSubdir() {
2727
* Imagine Ghost runs with http, but nginx allows SSL connections.
2828
*
2929
* @callback getSiteUrlFn
30-
* @param {boolean} [secure] optionally force the url to be secure
3130
* @return {string} returns the url as defined in config, but always with a trailing `/`
3231
*/
33-
function getSiteUrl(secure = false) {
32+
function getSiteUrl() {
3433
let siteUrl = this.get('url');
3534

36-
if (secure) {
37-
siteUrl = siteUrl.replace('http://', 'https://');
38-
}
39-
4035
if (!siteUrl.match(/\/$/)) {
4136
siteUrl += '/';
4237
}

packages/config-url-helpers/test/config-url-helpers.test.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,6 @@ describe('Config URL Helpers', function () {
7272

7373
nconf.getSiteUrl().should.eql('http://example.com/');
7474
});
75-
76-
it('returns https if secure=true', function () {
77-
fakeConfig.url = 'http://example.com/';
78-
79-
nconf.getSiteUrl(true).should.eql('https://example.com/');
80-
});
8175
});
8276

8377
describe('getAdminUrl', function () {

0 commit comments

Comments
 (0)