class Bundler::URI::HTTP
def authority
Bundler::URI::HTTP.build(host: 'www.example.com', port: 80, path: '/foo/bar').authority #=> "www.example.com"
Bundler::URI::HTTP.build(host: 'www.example.com', port: 8000, path: '/foo/bar').authority #=> "www.example.com:8000"
Bundler::URI::HTTP.build(host: 'www.example.com', path: '/foo/bar').authority #=> "www.example.com"
Example:
https://datatracker.ietf.org/doc/html/rfc3986/#section-3.2.
Returns the authority for an HTTP uri, as defined in
== Description
def authority if port == default_port host else "#{host}:#{port}" end end