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:
authorRobert Speicher <rspeicher@gmail.com>2015-12-02 02:45:36 +0300
committerRobert Speicher <rspeicher@gmail.com>2015-12-08 00:57:26 +0300
commitd5ea93469b4ec95916361c61876c949f60539211 (patch)
treea2a91371b4709725734016910ffb782b2dfd45a2 /app/models/hooks
parent2928e19d4356683119cf0d2bb269752253ea5d50 (diff)
Add custom UrlValidator
Diffstat (limited to 'app/models/hooks')
-rw-r--r--app/models/hooks/web_hook.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/app/models/hooks/web_hook.rb b/app/models/hooks/web_hook.rb
index 2caf26cc8c9..715ec5908b7 100644
--- a/app/models/hooks/web_hook.rb
+++ b/app/models/hooks/web_hook.rb
@@ -31,8 +31,7 @@ class WebHook < ActiveRecord::Base
# HTTParty timeout
default_timeout Gitlab.config.gitlab.webhook_timeout
- validates :url, presence: true,
- format: { with: /\A#{URI.regexp(%w(http https))}\z/, message: "should be a valid url" }
+ validates :url, presence: true, url: true
def execute(data, hook_name)
parsed_url = URI.parse(url)