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:
authorDouwe Maan <douwe@selenight.nl>2018-04-02 18:13:47 +0300
committerDouwe Maan <douwe@selenight.nl>2018-04-02 18:24:19 +0300
commitb290d929bc2f2d1d4922c046a84543744b67b982 (patch)
tree27bf1e40f673f00cd082a4993a27af35c83a14f3 /app/validators
parentb95918dda8c6cd5328d028492d36c3ee07e35943 (diff)
Rename allow_private_networks to allow_local_network
Diffstat (limited to 'app/validators')
-rw-r--r--app/validators/importable_url_validator.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/validators/importable_url_validator.rb b/app/validators/importable_url_validator.rb
index cafb43e69a2..612d3c71913 100644
--- a/app/validators/importable_url_validator.rb
+++ b/app/validators/importable_url_validator.rb
@@ -4,10 +4,8 @@
# protect against Server-side Request Forgery (SSRF).
class ImportableUrlValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
- begin
- Gitlab::UrlBlocker.validate!(value, valid_ports: Project::VALID_IMPORT_PORTS)
- rescue Gitlab::UrlBlocker::BlockedUrlError => e
- record.errors.add(attribute, "is blocked: #{e.message}")
- end
+ Gitlab::UrlBlocker.validate!(value, valid_ports: Project::VALID_IMPORT_PORTS)
+ rescue Gitlab::UrlBlocker::BlockedUrlError => e
+ record.errors.add(attribute, "is blocked: #{e.message}")
end
end