Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2017-06-06 16:49:58 +0300
committerGrzegorz Bizon <grzegorz@gitlab.com>2017-06-06 16:49:58 +0300
commit9f3a1203dfd3452a929dc70d9b25cbf2457c353a (patch)
tree9467d24d5960f3940e32981e7782e83d0c23a306 /app/models
parent35083dc9e799cafb74614f04fafd5e6b5350fd21 (diff)
parent8df7bcf532c9f0407fcefa12d205cb9d160fe5f4 (diff)
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.rb4
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