Skip to content

Conversation

@elrafoon
Copy link

@elrafoon elrafoon commented Oct 8, 2024

Hello,

related RFC requires it this way, and also at least apache would reject non-bracketed ipv6 host address with Bad Request.

I don't know any better way how to do this, except for modifying the nourl parser to return hostname type (ipv4, ipv6, domain name).

Also see corresponding work here:
rmja/nourl#2

Related RFC requires it this way, and also at least apache would reject
non-bracketed ipv6 host address with Bad Request.
@rmja
Copy link
Member

rmja commented Oct 9, 2024

Hi,

Is it not possible to simply let the brackets be part of the host value? Or is that incorrect?

@elrafoon
Copy link
Author

elrafoon commented Oct 9, 2024

That host value would be fed into underlying impl embedded_nal_aync::Dns dns resolver, that in my opinion would not accept square-bracketed IPv6 addresses, because no internet standard (RFCs) requires it to do so.

When looking into sources of core::net::Ipv6Addr, it seems it would fail parsing bracketed ipv6 address.

So this is not an option IMHO.

@elrafoon
Copy link
Author

elrafoon commented Oct 9, 2024

Other option would be to extend nourl to return some enum with resolved host type - domain name / ipv4 / ipv6 - and use that information.

@rmja
Copy link
Member

rmja commented Oct 14, 2024

Year, that is probably a better idea. It seems wrong to re-parse the host, only to determine if it is an ipv6 host.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants