mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 03:25:13 +00:00
LibURL: Set IDNA's CheckHyphens to the value of beStrict
See: https://github.com/whatwg/url/commit/cd8f1d
This commit is contained in:
parent
24267db6b2
commit
5dfb825c5c
Notes:
github-actions[bot]
2024-12-05 16:30:50 +00:00
Author: https://github.com/shannonbooth Commit: https://github.com/LadybirdBrowser/ladybird/commit/5dfb825c5c0 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2675
1 changed files with 9 additions and 2 deletions
|
@ -500,7 +500,14 @@ static bool ends_in_a_number_checker(StringView input)
|
|||
// https://url.spec.whatwg.org/#concept-domain-to-ascii
|
||||
static ErrorOr<String> domain_to_ascii(StringView domain, bool be_strict)
|
||||
{
|
||||
// 1. Let result be the result of running Unicode ToASCII with domain_name set to domain, UseSTD3ASCIIRules set to beStrict, CheckHyphens set to false, CheckBidi set to true, CheckJoiners set to true, Transitional_Processing set to false, and VerifyDnsLength set to beStrict. [UTS46]
|
||||
// 1. Let result be the result of running Unicode ToASCII with domain_name set to domain,
|
||||
// CheckHyphens set to beStrict,
|
||||
// CheckBidi set to true,
|
||||
// CheckJoiners set to true,
|
||||
// UseSTD3ASCIIRules set to beStrict,
|
||||
// Transitional_Processing set to false,
|
||||
// VerifyDnsLength set to beStrict. [UTS46].
|
||||
|
||||
// 2. If result is a failure value, domain-to-ASCII validation error, return failure.
|
||||
|
||||
// OPTIMIZATION: If beStrict is false, domain is an ASCII string, and strictly splitting domain on U+002E (.)
|
||||
|
@ -526,7 +533,7 @@ static ErrorOr<String> domain_to_ascii(StringView domain, bool be_strict)
|
|||
}
|
||||
|
||||
Unicode::IDNA::ToAsciiOptions const options {
|
||||
Unicode::IDNA::CheckHyphens::No,
|
||||
be_strict ? Unicode::IDNA::CheckHyphens::Yes : Unicode::IDNA::CheckHyphens::No,
|
||||
Unicode::IDNA::CheckBidi::Yes,
|
||||
Unicode::IDNA::CheckJoiners::Yes,
|
||||
be_strict ? Unicode::IDNA::UseStd3AsciiRules::Yes : Unicode::IDNA::UseStd3AsciiRules::No,
|
||||
|
|
Loading…
Add table
Reference in a new issue