Commit 5ca836048d4f3319d24d2d4580912102eed54618
1 parent
be6e52c2
Exists in
master
and in
4 other branches
Use URI::regexp for validating WebHook urls
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
app/models/web_hook.rb
... | ... | @@ -9,7 +9,7 @@ class WebHook < ActiveRecord::Base |
9 | 9 | validates :url, |
10 | 10 | presence: true, |
11 | 11 | format: { |
12 | - with: /(^$)|(^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$)/ix, | |
12 | + with: URI::regexp(%w(http https)), | |
13 | 13 | message: "should be a valid url" } |
14 | 14 | |
15 | 15 | def execute(data) | ... | ... |