Commit 5ca836048d4f3319d24d2d4580912102eed54618

Authored by Ariejan de Vroom
1 parent be6e52c2

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,7 +9,7 @@ class WebHook < ActiveRecord::Base
9 validates :url, 9 validates :url,
10 presence: true, 10 presence: true,
11 format: { 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 message: "should be a valid url" } 13 message: "should be a valid url" }
14 14
15 def execute(data) 15 def execute(data)