LibURL: Publicly expose ability to parse a host

This is used by the HTML specification.
This commit is contained in:
Shannon Booth 2025-06-26 14:21:17 +12:00 committed by Shannon Booth
commit 1f4bbc2bfb
Notes: github-actions[bot] 2025-06-27 06:47:11 +00:00
2 changed files with 3 additions and 1 deletions

View file

@ -551,7 +551,7 @@ static ErrorOr<String> domain_to_ascii(StringView domain, bool be_strict)
}
// https://url.spec.whatwg.org/#concept-host-parser
static Optional<Host> parse_host(StringView input, bool is_opaque = false)
Optional<Host> Parser::parse_host(StringView input, bool is_opaque)
{
// 1. If input starts with U+005B ([), then:
if (input.starts_with('[')) {

View file

@ -65,6 +65,8 @@ public:
// https://url.spec.whatwg.org/#shorten-a-urls-path
static void shorten_urls_path(URL&);
static Optional<Host> parse_host(StringView input, bool is_opaque = false);
};
#undef ENUMERATE_STATES