Removed support for mixed http/https mode

refs: https://github.com/TryGhost/Ghost/issues/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
This commit is contained in:
Hannah Wolfe 2022-05-11 10:35:00 +01:00
parent 4627a77a99
commit 2a9fca6427
2 changed files with 1 additions and 12 deletions

View File

@ -27,16 +27,11 @@ function getSubdir() {
* Imagine Ghost runs with http, but nginx allows SSL connections.
*
* @callback getSiteUrlFn
* @param {boolean} [secure] optionally force the url to be secure
* @return {string} returns the url as defined in config, but always with a trailing `/`
*/
function getSiteUrl(secure = false) {
function getSiteUrl() {
let siteUrl = this.get('url');
if (secure) {
siteUrl = siteUrl.replace('http://', 'https://');
}
if (!siteUrl.match(/\/$/)) {
siteUrl += '/';
}

View File

@ -72,12 +72,6 @@ describe('Config URL Helpers', function () {
nconf.getSiteUrl().should.eql('http://example.com/');
});
it('returns https if secure=true', function () {
fakeConfig.url = 'http://example.com/';
nconf.getSiteUrl(true).should.eql('https://example.com/');
});
});
describe('getAdminUrl', function () {