LibWeb: Actually run UTF-8 decode without BOM

This fixes a crash using URLSearchParams when provided a percent encoded
string which does not percent decode to valid UTF-8.

Fixes a crash running https://wpt.live/url/urlencoded-parser.any.html
This commit is contained in:
Shannon Booth 2024-08-10 17:56:35 +12:00 committed by Andreas Kling
commit 9c72fc9642
Notes: github-actions[bot] 2024-08-10 08:47:22 +00:00
3 changed files with 14 additions and 2 deletions

View file

@ -0,0 +1,10 @@
<script src="../include.js"></script>
<script>
test(() => {
const params = new URLSearchParams('%FE%FF');
for (const [key, value] of params) {
println(`key equals = ${"\uFFFD\uFFFD" === key}`);
println(`value equals = ${"" === value}`);
}
});
</script>