Generate HTTP URLs for custom Pages domains when appropriate
This commit is contained in:
parent
2c66b942bd
commit
75e718f207
|
@ -27,7 +27,7 @@ class PagesDomain < ActiveRecord::Base
|
||||||
def url
|
def url
|
||||||
return unless domain
|
return unless domain
|
||||||
|
|
||||||
if certificate
|
if certificate.present?
|
||||||
"https://#{domain}"
|
"https://#{domain}"
|
||||||
else
|
else
|
||||||
"http://#{domain}"
|
"http://#{domain}"
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: Generate HTTP URLs for custom Pages domains when appropriate
|
||||||
|
merge_request: 16279
|
||||||
|
author:
|
||||||
|
type: fixed
|
|
@ -68,7 +68,7 @@ describe PagesDomain do
|
||||||
subject { domain.url }
|
subject { domain.url }
|
||||||
|
|
||||||
context 'without the certificate' do
|
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') }
|
it { is_expected.to eq('http://my.domain.com') }
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue