Skip to content
Snippets Groups Projects
Commit 5ca83604 authored by Ariejan de Vroom's avatar Ariejan de Vroom
Browse files

Use URI::regexp for validating WebHook urls

parent be6e52c2
No related branches found
No related tags found
1 merge request!193work-in-progress - Web Hooks
Loading
Loading
@@ -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
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment