From 89f7bac3ba980019e6a75f869dec69da5d7a69ab Mon Sep 17 00:00:00 2001 From: Thong Kuah Date: Wed, 20 Feb 2019 10:50:58 +1300 Subject: [PATCH] Comment why we can't use Gitlab::CurrentSettings See https://gitlab.com/gitlab-org/gitlab-ee/issues/9833 --- app/validators/url_validator.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/validators/url_validator.rb b/app/validators/url_validator.rb index d3e32818dc7..3fd015c3cf5 100644 --- a/app/validators/url_validator.rb +++ b/app/validators/url_validator.rb @@ -93,6 +93,12 @@ class UrlValidator < ActiveModel::EachValidator end def allow_setting_local_requests? + # We cannot use Gitlab::CurrentSettings as ApplicationSetting itself + # uses UrlValidator to validate urls. This ends up in a cycle + # when Gitlab::CurrentSettings creates an ApplicationSetting which then + # calls this validator. + # + # See https://gitlab.com/gitlab-org/gitlab-ee/issues/9833 ApplicationSetting.current&.allow_local_requests_from_hooks_and_services? end end