Use URI::regexp for validating WebHook urls
This commit is contained in:
parent
be6e52c2f6
commit
5ca836048d
1 changed files with 1 additions and 1 deletions
|
@ -9,7 +9,7 @@ class WebHook < ActiveRecord::Base
|
|||
validates :url,
|
||||
presence: true,
|
||||
format: {
|
||||
with: /(^$)|(^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$)/ix,
|
||||
with: URI::regexp(%w(http https)),
|
||||
message: "should be a valid url" }
|
||||
|
||||
def execute(data)
|
||||
|
|
Loading…
Reference in a new issue