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:
parent
4627a77a99
commit
2a9fca6427
@ -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 += '/';
|
||||
}
|
||||
|
@ -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 () {
|
||||
|
Loading…
Reference in New Issue
Block a user