mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-21 15:57:31 +09:00
moebius#131: URL parser - stop preserving empty passwords
https://github.com/MoonchildProductions/moebius/issues/131
This commit is contained in:
parent
5622e56123
commit
de0621cc7e
4 changed files with 31 additions and 5 deletions
|
|
@ -472,3 +472,23 @@ add_test(function test_invalidHostChars() {
|
|||
// hostname separators, so there is no way to set them and fail.
|
||||
run_next_test();
|
||||
});
|
||||
|
||||
add_test(function test_emptyPassword() {
|
||||
var url = stringToURL("http://a:@example.com");
|
||||
do_check_eq(url.spec, "http://a@example.com/");
|
||||
url.password = "pp";
|
||||
do_check_eq(url.spec, "http://a:pp@example.com/");
|
||||
url.password = "";
|
||||
do_check_eq(url.spec, "http://a@example.com/");
|
||||
url.userPass = "xxx:";
|
||||
do_check_eq(url.spec, "http://xxx@example.com/");
|
||||
url.password = "zzzz";
|
||||
do_check_eq(url.spec, "http://xxx:zzzz@example.com/");
|
||||
url.userPass = "xxxxx:yyyyyy";
|
||||
do_check_eq(url.spec, "http://xxxxx:yyyyyy@example.com/");
|
||||
url.userPass = "z:";
|
||||
do_check_eq(url.spec, "http://z@example.com/");
|
||||
url.password = "ppppppppppp";
|
||||
do_check_eq(url.spec, "http://z:ppppppppppp@example.com/");
|
||||
run_next_test();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue