summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorVladimir Shushlin <vshushlin@gitlab.com>2019-07-22 15:38:08 +0000
committerNick Thomas <nick@gitlab.com>2019-07-22 15:38:08 +0000
commit77e2e453649220ba9c002c935bbc18c34fbf5b11 (patch)
tree7e08870937bc55583fbf5d82e4448f58605749e8 /app/models
parente48851de62086b65c75a3dd802743e722d5d7be8 (diff)
downloadgitlab-ce-77e2e453649220ba9c002c935bbc18c34fbf5b11.tar.gz
Validate certificate chain only if it's changed
This validation prevents the domain from being saved from the UI e.g. when user tries to enable Let's Encrypt integration
Diffstat (limited to 'app/models')
-rw-r--r--app/models/pages_domain.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/pages_domain.rb b/app/models/pages_domain.rb
index e6e491634ab..27c122d3559 100644
--- a/app/models/pages_domain.rb
+++ b/app/models/pages_domain.rb
@@ -22,7 +22,7 @@ class PagesDomain < ApplicationRecord
validate :validate_pages_domain
validate :validate_matching_key, if: ->(domain) { domain.certificate.present? || domain.key.present? }
- validate :validate_intermediates, if: ->(domain) { domain.certificate.present? }
+ validate :validate_intermediates, if: ->(domain) { domain.certificate.present? && domain.certificate_changed? }
attr_encrypted :key,
mode: :per_attribute_iv_and_salt,