mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-30 05:08:56 +00:00
LibURL: Validate for invalid _domain_ code points for non-opaque domains
We were previously not checking for C0 control, U+0025 (%), or U+007F DELETE. This makes another good set of URL tests in WPT pass :^)
This commit is contained in:
committed by
Tim Ledbetter
parent
f511c0b441
commit
fdf4f1e887
@@ -512,3 +512,18 @@ TEST_CASE(ascii_only_url)
|
||||
EXPECT_EQ(url.to_byte_string(), "http://example.com/iNdEx.HtMl#fRaGmEnT");
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE(invalid_domain_code_points)
|
||||
{
|
||||
{
|
||||
constexpr auto upper_case_url = "http://example%25.com"sv;
|
||||
URL::URL url(upper_case_url);
|
||||
EXPECT(!url.is_valid());
|
||||
}
|
||||
|
||||
{
|
||||
constexpr auto mixed_case_url = "http://thing\u0007y/'"sv;
|
||||
URL::URL url(mixed_case_url);
|
||||
EXPECT(!url.is_valid());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user