Sha256: 9dc9e512b48eda1732aec2059a85f72bb2a826d00374e80121bca1ea724364bb

Contents?: true

Size: 443 Bytes

Versions: 20

Compression:

Stored size: 443 Bytes

Contents

# frozen_string_literal: true

module HTTPX
  module Punycode
    module_function

    begin
      require "idnx"

      def encode_hostname(hostname)
        Idnx.to_punycode(hostname)
      end
    rescue LoadError
      def encode_hostname(hostname)
        warn "#{hostname} cannot be converted to punycode. Install the " \
             "\"idnx\" gem: https://github.com/HoneyryderChuck/idnx"

        hostname
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
httpx-1.3.4 lib/httpx/punycode.rb
httpx-1.3.3 lib/httpx/punycode.rb
httpx-1.3.2 lib/httpx/punycode.rb
httpx-1.3.1 lib/httpx/punycode.rb
httpx-1.3.0 lib/httpx/punycode.rb
httpx-1.2.6 lib/httpx/punycode.rb
httpx-1.2.4 lib/httpx/punycode.rb
httpx-1.2.3 lib/httpx/punycode.rb
httpx-1.2.2 lib/httpx/punycode.rb
httpx-1.2.1 lib/httpx/punycode.rb
httpx-1.2.0 lib/httpx/punycode.rb
httpx-1.1.5 lib/httpx/punycode.rb
httpx-1.1.4 lib/httpx/punycode.rb
httpx-1.1.3 lib/httpx/punycode.rb
httpx-1.1.2 lib/httpx/punycode.rb
httpx-1.1.1 lib/httpx/punycode.rb
httpx-1.1.0 lib/httpx/punycode.rb
httpx-1.0.2 lib/httpx/punycode.rb
httpx-1.0.1 lib/httpx/punycode.rb
httpx-1.0.0 lib/httpx/punycode.rb