Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Host Parsing of IPv6-URI with port #12

Open
@kronthto

Description

@kronthto

Hi,

As you probably know IPv6 addresses with ports are wrapped in square brackets (because the colon sign also appears in the IP address itself).

These brackets are not treated (removed) in any way currently, what leads to an behaviour I didn't expect.
I'd expect getHost() to return only the IP address, without brackets, as the port is stored seperately and obtainable via getPort().

Consider this example:

$ipv4Port = new \Zend\Uri\Uri('http://192.168.0.1:8080');
$ipv6Port = new \Zend\Uri\Uri('http://[fe80::240:63ff:fede:3c19]:8080');

echo $ipv4Port->getHost(); // -> 192.168.0.1 - expected
echo $ipv6Port->getHost(); // -> [fe80::240:63ff:fede:3c19] - unexpected

Is this intended behaviour, though, or just not yet adjusted to IPv6?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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