LibWeb: Actually set empty serialized query to OptionalNone

Because the type returned by to_string is a String, _not_ an
Optional<String>, the following code:

if (serialized_query.is_empty())
    serialized_query = {};

Was achieving nothing at all! Make sure that the type is an
Optional<String> so that we're not just setting an empty string to an
empty string.
This commit is contained in:
Shannon Booth
2024-08-11 00:39:07 +12:00
committed by Tim Ledbetter
parent 1ba6dbd86c
commit d755a83c09
Notes: github-actions[bot] 2024-08-12 22:02:25 +00:00
3 changed files with 15 additions and 3 deletions

View File

@@ -0,0 +1,9 @@
<script src="../include.js"></script>
<script>
test(() => {
let url = new URL("https://www.birdoftheyear.org.nz/?")
println(url.href);
url.searchParams.sort()
println(url.href);
});
</script>