mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:48:11 +00:00

This fixes URL fragments containing characters in the fragment encoding set that were not being correctly percent encoded.
29 lines
983 B
HTML
29 lines
983 B
HTML
<script src="../include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
function printURL(input) {
|
|
println(input);
|
|
const url = new URL(input);
|
|
println(`protocol => '${url.protocol}'`);
|
|
println(`username => '${url.username}'`);
|
|
println(`password => '${url.password}'`);
|
|
println(`host => '${url.host}'`);
|
|
println(`hostname => '${url.hostname}'`);
|
|
println(`port => '${url.port}'`);
|
|
println(`pathname => '${url.pathname}'`);
|
|
println(`search => '${url.search}'`);
|
|
println(`hash => '${url.hash}'`);
|
|
}
|
|
|
|
for (url of [
|
|
'ftp://serenityos.org:21',
|
|
'http://[0:1:0:1:0:1:0:1]',
|
|
'http://[1:0:1:0:1:0:1:0]',
|
|
'http://[1:1:0:0:1:0:0:0]/',
|
|
'unknown://serenityos.org:0',
|
|
'http://serenityos.org/cat?dog#meow"woof',
|
|
]) {
|
|
printURL(url);
|
|
}
|
|
});
|
|
</script>
|