mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
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
22 lines
544 B
HTML
22 lines
544 B
HTML
<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>
|