Skip to content

Incorrect Host header for IPv6 addresses #73

@AEtherC0r3

Description

@AEtherC0r3

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions