mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 07:37:03 +00:00
LibURL: Fix heuristic for URL domain parsing IDNA fast path
Our heuristic was a bit too simplistic and would not run through the ToASCII unicode algorithm which performs some extra validation. This would cause invalid URLs that should fail to be parsed be mistakenly accepted. This fixes 8 tests in: https://wpt.live/url/url-constructor.any.html
This commit is contained in:
parent
fd4e943e12
commit
db3f118046
Notes:
github-actions[bot]
2024-08-06 22:09:08 +00:00
Author: https://github.com/shannonbooth
Commit: db3f118046
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/987
Reviewed-by: https://github.com/tcl3 ✅
3 changed files with 39 additions and 4 deletions
21
Tests/LibWeb/Text/input/URL/invalid-urls.html
Normal file
21
Tests/LibWeb/Text/input/URL/invalid-urls.html
Normal file
|
@ -0,0 +1,21 @@
|
|||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
const urls = [
|
||||
{ input: 'file://xn--/p' },
|
||||
];
|
||||
|
||||
for (url of urls) {
|
||||
if (url.base === undefined)
|
||||
println(`new URL('${url.input}', ${url.base})`);
|
||||
else
|
||||
println(`new URL('${url.input}', '${url.base}')`);
|
||||
|
||||
try {
|
||||
new URL(url.input, url.base);
|
||||
} catch (e) {
|
||||
println(`error creating URL: '${e}'`);
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue