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

AK: Properly implement steps for shortening a URLs path

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.
This commit is contained in:
Shannon Booth 2023-09-17 13:15:52 +12:00 committed by Andreas Kling
parent bfdf7779ce
commit 453dd0cf44
4 changed files with 36 additions and 6 deletions

View file

@ -27,6 +27,7 @@
{ input: 'unknown://serenityos.org:0' },
{ input: 'http://serenityos.org/cat?dog#meow"woof' },
{ input: '/hello', base: 'file://friends/' },
{ input: '//d:/..', base: 'file:///C:/a/b' },
]) {
printURL(url.input, url.base);
}