mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 22:45:07 +00:00

Instead of implementing this inline, put it into a function. Use this new function to correctly implement shortening paths for some places where this logic was previously missing. Before these changes, the pathname for the included test was incorrectly being set to '/' as we were not considering the windows drive letter.
80 lines
1.6 KiB
Text
80 lines
1.6 KiB
Text
new URL('ftp://serenityos.org:21', undefined)
|
|
protocol => 'ftp:'
|
|
username => ''
|
|
password => ''
|
|
host => 'serenityos.org'
|
|
hostname => 'serenityos.org'
|
|
port => ''
|
|
pathname => '/'
|
|
search => ''
|
|
hash => ''
|
|
new URL('http://[0:1:0:1:0:1:0:1]', undefined)
|
|
protocol => 'http:'
|
|
username => ''
|
|
password => ''
|
|
host => '[0:1:0:1:0:1:0:1]'
|
|
hostname => '[0:1:0:1:0:1:0:1]'
|
|
port => ''
|
|
pathname => '/'
|
|
search => ''
|
|
hash => ''
|
|
new URL('http://[1:0:1:0:1:0:1:0]', undefined)
|
|
protocol => 'http:'
|
|
username => ''
|
|
password => ''
|
|
host => '[1:0:1:0:1:0:1:0]'
|
|
hostname => '[1:0:1:0:1:0:1:0]'
|
|
port => ''
|
|
pathname => '/'
|
|
search => ''
|
|
hash => ''
|
|
new URL('http://[1:1:0:0:1:0:0:0]/', undefined)
|
|
protocol => 'http:'
|
|
username => ''
|
|
password => ''
|
|
host => '[1:1:0:0:1::]'
|
|
hostname => '[1:1:0:0:1::]'
|
|
port => ''
|
|
pathname => '/'
|
|
search => ''
|
|
hash => ''
|
|
new URL('unknown://serenityos.org:0', undefined)
|
|
protocol => 'unknown:'
|
|
username => ''
|
|
password => ''
|
|
host => 'serenityos.org:0'
|
|
hostname => 'serenityos.org'
|
|
port => '0'
|
|
pathname => ''
|
|
search => ''
|
|
hash => ''
|
|
new URL('http://serenityos.org/cat?dog#meow"woof', undefined)
|
|
protocol => 'http:'
|
|
username => ''
|
|
password => ''
|
|
host => 'serenityos.org'
|
|
hostname => 'serenityos.org'
|
|
port => ''
|
|
pathname => '/cat'
|
|
search => '?dog'
|
|
hash => '#meow%22woof'
|
|
new URL('/hello', 'file://friends/')
|
|
protocol => 'file:'
|
|
username => ''
|
|
password => ''
|
|
host => 'friends'
|
|
hostname => 'friends'
|
|
port => ''
|
|
pathname => '/hello'
|
|
search => ''
|
|
hash => ''
|
|
new URL('//d:/..', 'file:///C:/a/b')
|
|
protocol => 'file:'
|
|
username => ''
|
|
password => ''
|
|
host => ''
|
|
hostname => ''
|
|
port => ''
|
|
pathname => '/d:/'
|
|
search => ''
|
|
hash => ''
|