When specifying a URI with an IPv6 address as the host, the Host header of the request contains the IPv6 address but it is not surrounded by brackets
e.g. With a locally running apache webserver, the following snippet results in an HTTP 400 Bad Request error because of the malformed host header (Host: ::1 instead of Host: [::1])
require 'net/http'
uri = URI.parse('http://[::1]')
Net::HTTP.get_response(uri)