diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-06-06 13:49:58 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-06-06 13:49:58 +0000 |
commit | 9f3a1203dfd3452a929dc70d9b25cbf2457c353a (patch) | |
tree | 9467d24d5960f3940e32981e7782e83d0c23a306 /app/models | |
parent | 35083dc9e799cafb74614f04fafd5e6b5350fd21 (diff) | |
parent | 8df7bcf532c9f0407fcefa12d205cb9d160fe5f4 (diff) | |
download | gitlab-ce-9f3a1203dfd3452a929dc70d9b25cbf2457c353a.tar.gz |
Merge branch '29271-fix-pages-numeric-domain' into 'master'
Allow numeric pages domain
Closes #29271
See merge request !11927
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/pages_domain.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/pages_domain.rb b/app/models/pages_domain.rb index f2f2fc1e32a..5d798247863 100644 --- a/app/models/pages_domain.rb +++ b/app/models/pages_domain.rb @@ -1,7 +1,7 @@ class PagesDomain < ActiveRecord::Base belongs_to :project - validates :domain, hostname: true + validates :domain, hostname: { allow_numeric_hostname: true } validates :domain, uniqueness: { case_sensitive: false } validates :certificate, certificate: true, allow_nil: true, allow_blank: true validates :key, certificate_key: true, allow_nil: true, allow_blank: true @@ -98,7 +98,7 @@ class PagesDomain < ActiveRecord::Base def validate_pages_domain return unless domain - if domain.downcase.ends_with?(".#{Settings.pages.host}".downcase) + if domain.downcase.ends_with?(Settings.pages.host.downcase) self.errors.add(:domain, "*.#{Settings.pages.host} is restricted") end end |