Skip to content

fix(request): if host is ipv6 address, enclose it in square brackets - #92

Open
elrafoon wants to merge 1 commit into
drogue-iot:mainfrom
elrafoon:ipv6-host
Open

fix(request): if host is ipv6 address, enclose it in square brackets#92
elrafoon wants to merge 1 commit into
drogue-iot:mainfrom
elrafoon:ipv6-host

Conversation

@elrafoon

@elrafoon elrafoon commented Oct 8, 2024

Copy link
Copy Markdown

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

rmja commented Oct 9, 2024

Copy link
Copy Markdown
Member

Hi,

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

@elrafoon

elrafoon commented Oct 9, 2024

Copy link
Copy Markdown
Author

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

elrafoon commented Oct 9, 2024

Copy link
Copy Markdown
Author

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

@rmja

rmja commented Oct 14, 2024

Copy link
Copy Markdown
Member

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