mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:17:35 +00:00
AK: Do not trim away non-ASCII bytes when parsing URL
Because non-ASCII code points have negative byte values, trimming away control characters requires checking for negative bytes values. This also adds a test case with a URL containing non-ASCII code points.
This commit is contained in:
parent
44937e2dfc
commit
99d5555134
2 changed files with 11 additions and 2 deletions
|
@ -328,3 +328,12 @@ TEST_CASE(leading_and_trailing_whitespace)
|
|||
EXPECT(url.is_valid());
|
||||
EXPECT_EQ(url.to_string(), "https://foo.com/");
|
||||
}
|
||||
|
||||
TEST_CASE(unicode)
|
||||
{
|
||||
URL url { "http://example.com/_ünicöde_téxt_©" };
|
||||
EXPECT(url.is_valid());
|
||||
EXPECT_EQ(url.path(), "/_ünicöde_téxt_©");
|
||||
EXPECT(url.query().is_null());
|
||||
EXPECT(url.fragment().is_null());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue