Commit graph

6 commits

Author SHA1 Message Date
Timothy Flynn
ee6b2db009 AK+LibURL+LibWeb: Use simdutf to validate ASCII strings
simdutf provides a vectorized ASCII validator, so let's use that instead
of looping over strings manually.
2025-04-06 11:05:58 -04:00
Timothy Flynn
a34f7a5bd1 LibURL: Correctly acquire the registrable domain for a URL
We were using the public suffix of the URL's host as its registrable
domain. But the registrable domain is actually the public suffix plus
one additional label.
2025-03-11 12:10:42 +01:00
Sam Atkins
9a7ce901b7 LibURL: Gracefully handle a host having no public suffix
Specifically, after implementing some recent spec changes to navigables,
we end up calling `get_public_suffix("localhost")` here, which returns
OptionalNone. This would previously crash.

Our get_public_suffix() seems a little incorrect. From the spec:
> If no rules match, the prevailing rule is "*".
> https://github.com/publicsuffix/list/wiki/Format#algorithm

However, ours returns an empty Optional in that case. To avoid breaking
other users of it, this patch modifies Host's uses of it, rather than
the function itself.
2025-01-21 18:17:18 +01:00
Shannon Booth
24267db6b2 LibURL: Implement "find the IPv6 address compressed piece index" helper
This was an editorial change in the spec to put a somewhat complex spec
step in it's own AO.
2024-12-05 17:29:49 +01:00
Sam Atkins
7f7f6e490b LibURL: Implement Host::public_suffix() and registrable_domain()
These algorithms are used in following commits.
2024-11-30 12:07:39 +01:00
Sam Atkins
63688148b9 LibURL: Promote Host to a proper class
This lets us move a few Host-related functions (like serialization and
checks for what the Host is) into Host instead of having them dotted
around the codebase.

For now, the interface is still very Variant-like, to avoid having to
change quite so much in one go.
2024-11-30 12:07:39 +01:00