line/armeria

Loosen the validation rule for `Endpoint.host()`

ikhoon opened this issue · 0 comments

The underscore (_) character is not permitted in hostnames but is allowed in other contexts, such as DNS SRV records.

Currently, URI.parseServerAuthority() is used to validate a hostname of an Endpoint which disallows _.

final URI uri = new URI(null, authorityWithoutUserInfo, null, null, null).parseServerAuthority();

Armeria internally, Endpoint.host() is used for both DNS and a hostname of a URI. So I think we may loosen the validation rule to allow _ and use it for DNS queries and results.

Discord thread: https://discord.com/channels/1087271586832318494/1087272728177942629/1262912254333030451