diff options
author | Nick Thomas <nick@gitlab.com> | 2018-01-08 01:27:19 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-01-08 01:30:05 +0000 |
commit | 75e718f207083615252b9ef047c4c466d9fcb5a0 (patch) | |
tree | b031eb6cffe3343d5cb1310b95307d9a06d3e3af | |
parent | 2c66b942bde756554b22d8b54c586fe45f544b0e (diff) | |
download | gitlab-ce-75e718f207083615252b9ef047c4c466d9fcb5a0.tar.gz |
Generate HTTP URLs for custom Pages domains when appropriate
-rw-r--r-- | app/models/pages_domain.rb | 2 | ||||
-rw-r--r-- | changelogs/unreleased/28260-fix-pages-custom-domain-url.yml | 5 | ||||
-rw-r--r-- | spec/models/pages_domain_spec.rb | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/app/models/pages_domain.rb b/app/models/pages_domain.rb index 8de42ff9d2e..d8bf54e0c40 100644 --- a/app/models/pages_domain.rb +++ b/app/models/pages_domain.rb @@ -27,7 +27,7 @@ class PagesDomain < ActiveRecord::Base def url return unless domain - if certificate + if certificate.present? "https://#{domain}" else "http://#{domain}" diff --git a/changelogs/unreleased/28260-fix-pages-custom-domain-url.yml b/changelogs/unreleased/28260-fix-pages-custom-domain-url.yml new file mode 100644 index 00000000000..edd63c4ea9c --- /dev/null +++ b/changelogs/unreleased/28260-fix-pages-custom-domain-url.yml @@ -0,0 +1,5 @@ +--- +title: Generate HTTP URLs for custom Pages domains when appropriate +merge_request: 16279 +author: +type: fixed diff --git a/spec/models/pages_domain_spec.rb b/spec/models/pages_domain_spec.rb index 7d835511dfb..9d12f96c642 100644 --- a/spec/models/pages_domain_spec.rb +++ b/spec/models/pages_domain_spec.rb @@ -68,7 +68,7 @@ describe PagesDomain do subject { domain.url } context 'without the certificate' do - let(:domain) { build(:pages_domain) } + let(:domain) { build(:pages_domain, certificate: '') } it { is_expected.to eq('http://my.domain.com') } end |