Sha256: 313ca7c412aa39a7e0f30de97b6e50ab26f881ec4d1d0dd61854ec88bb681370

Contents?: true

Size: 558 Bytes

Versions: 1

Compression:

Stored size: 558 Bytes

Contents

module OpenIDConnect
  module Discovery
    class Principal
      class URI < Principal
        def initialize(identifier)
          uri = normalize(identifier)
          @identifier = uri.to_s
          @host = uri.host
        end

        private

        def normalize(identifier)
          uri = ::URI.parse(identifier)
          if uri.host.blank?
            uri.host, uri.path = uri.path.split('/', 2)
            uri.path = File.join('/', uri.path)
          end
          uri.scheme ||= 'https'
          uri
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
openid_connect-0.0.13 lib/openid_connect/discovery/principal/uri.rb