Chatwoot/lib/url_helper.rb

12 lines
195 B
Ruby
Raw Permalink Normal View History

require 'uri'
module UrlHelper
def url_valid?(url)
url = begin
URI.parse(url)
rescue StandardError
false
end
url.is_a?(URI::HTTP) || url.is_a?(URI::HTTPS)
end
end