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
path: root/app
diff options
context:
space:
mode:
authorevuez <helloevuez@gmail.com>2016-02-22 15:55:36 +0300
committerRobert Speicher <rspeicher@gmail.com>2016-02-26 22:34:06 +0300
commit4d0e2979b9a17160ad93ff704e7a51f78b4f3b4c (patch)
tree1043f0701028e1abc9155821ae442da16a99a763 /app
parent01160fc06182de89c400af174861f6545ad6ceb8 (diff)
Allow webhooks URL to have leading and trailing spaces
Diffstat (limited to 'app')
-rw-r--r--app/validators/url_validator.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/validators/url_validator.rb b/app/validators/url_validator.rb
index 2848b9cd33d..a77beb2683d 100644
--- a/app/validators/url_validator.rb
+++ b/app/validators/url_validator.rb
@@ -29,8 +29,11 @@ class UrlValidator < ActiveModel::EachValidator
end
def valid_url?(value)
+ return false if value.nil?
+
options = default_options.merge(self.options)
+ value.strip!
value =~ /\A#{URI.regexp(options[:protocols])}\z/
end
end