diff options
Diffstat (limited to 'app/services/projects/import_service.rb')
-rw-r--r-- | app/services/projects/import_service.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/services/projects/import_service.rb b/app/services/projects/import_service.rb index fde56d8429e..e8a684e5da4 100644 --- a/app/services/projects/import_service.rb +++ b/app/services/projects/import_service.rb @@ -171,6 +171,8 @@ module Projects project.import_url, schemes: Project::VALID_IMPORT_PROTOCOLS, ports: Project::VALID_IMPORT_PORTS, + allow_localhost: allow_local_requests?, + allow_local_network: allow_local_requests?, dns_rebind_protection: dns_rebind_protection?) .then do |(import_url, resolved_host)| next '' if resolved_host.nil? || !import_url.scheme.in?(%w[http https]) @@ -179,6 +181,11 @@ module Projects end end + def allow_local_requests? + Rails.env.development? && # There is no known usecase for this in non-development environments + Gitlab::CurrentSettings.allow_local_requests_from_web_hooks_and_services? + end + def dns_rebind_protection? return false if Gitlab.http_proxy_env? |