1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:17:45 +00:00

AK: Add missing default port definitions for FTP scheme URLs

This is defined in the spec, but was missing in our table. Fix this, and
add a spec comment for what is missing. Also begin a basic text based
test for URL, so we can get some coverage of LibWeb's usage of URL too.
This commit is contained in:
Shannon Booth 2023-07-31 20:23:53 +12:00 committed by Andreas Kling
parent 25153703c9
commit 4fdd4dd979
3 changed files with 43 additions and 4 deletions

View file

@ -0,0 +1,23 @@
<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}'`);
}
for (url of [
'ftp://serenityos.org:21',
]) {
printURL(url);
}
});
</script>