Sha256: 21be39cbfa139cbe8319ad5372a59b03ede7e08c9b38dc60dc9c4e3c26a20081

Contents?: true

Size: 500 Bytes

Versions: 69

Compression:

Stored size: 500 Bytes

Contents

module Katello
  module KatelloUrlHelper
    unless defined? CONSTANTS_DEFINED
      FILEPREFIX = ['file'].freeze
      PROTOCOLS = ['http', 'https', 'ftp', 'uln'].freeze

      CONSTANTS_DEFINED = true
    end

    def kurl_valid?(url)
      return false if (scheme = URI.parse(url).scheme).blank?
      return true if FILEPREFIX.include?(scheme.downcase)
      URI.parse(url).host.present? && PROTOCOLS.include?(scheme.downcase)
    rescue URI::InvalidURIError
      return false
    end
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
katello-4.14.2 app/helpers/katello/katello_url_helper.rb
katello-4.14.1 app/helpers/katello/katello_url_helper.rb
katello-4.14.0 app/helpers/katello/katello_url_helper.rb
katello-4.14.0.rc3 app/helpers/katello/katello_url_helper.rb
katello-4.14.0.rc2 app/helpers/katello/katello_url_helper.rb
katello-4.14.0.rc1.1 app/helpers/katello/katello_url_helper.rb
katello-4.14.0.rc1 app/helpers/katello/katello_url_helper.rb
katello-4.13.1 app/helpers/katello/katello_url_helper.rb
katello-4.13.0 app/helpers/katello/katello_url_helper.rb
katello-4.12.1 app/helpers/katello/katello_url_helper.rb
katello-4.13.0.rc1 app/helpers/katello/katello_url_helper.rb
katello-4.12.0 app/helpers/katello/katello_url_helper.rb
katello-4.12.0.rc3 app/helpers/katello/katello_url_helper.rb
katello-4.12.0.rc2 app/helpers/katello/katello_url_helper.rb
katello-4.12.0.rc1 app/helpers/katello/katello_url_helper.rb
katello-4.11.1 app/helpers/katello/katello_url_helper.rb
katello-4.11.0 app/helpers/katello/katello_url_helper.rb
katello-4.11.0.rc2 app/helpers/katello/katello_url_helper.rb
katello-4.11.0.rc1 app/helpers/katello/katello_url_helper.rb
katello-4.10.0 app/helpers/katello/katello_url_helper.rb