The RFC 3986 grammar for `[...]` addresses accepts
IPv6 addresses and IPvFuture addresses, where the latter
have the form `'v' <hexDigit>+ '.' (<unreserved>|<sub-delim>|':')+`.
This allows the IPvFuture syntax, with no interpretation,
as the `host` of a `Uri`.
For now, the `Uri(host: ...)` constructor argument only allows
IPvFuture addresses that are already wrapped in `[...]` brackets,
and the `Uri.host` gette returns IPvFuture addresses including
brackets.
The `Uri(host:...)` still allows unbracketed IPv6 addresses
(distinguished from plain host-names by containing a `:`),
and `Uri.host` returns IPv6 addresses without brackets.
`Uri.parse` only accept IPv6 and IPvFuture in brackets.
(Only IPv6 can have a zone.)
Fixes#60483.
CoreLibraryReviewExempt: Local implementation only, no API.
Bug: https://dartbug.com/60483
Change-Id: Id369ba1316b34f443edfe5b0f56864c32beddccc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/421081
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Avoid doing computed shifts and parameterizing with
tables, so that all lookups can be with a fixed
base and only do one bit-operation.
Tested: Refactoring, covered by existing tests.
Change-Id: I8c4ffdb0eaef6c26de996ca40d1d697c1ba23bb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/392943
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>