mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 11:57:32 +09:00
moebius#130: URL parser - fix: don't allow empty host name
https://github.com/MoonchildProductions/moebius/issues/130
This commit is contained in:
parent
aa1df43166
commit
196fddddb6
14 changed files with 51 additions and 72 deletions
|
|
@ -79,23 +79,11 @@ function run_test() {
|
|||
|
||||
cm.removeAll();
|
||||
|
||||
// test that setting an empty or '.' http:// host results in a no-op
|
||||
var uri = NetUtil.newURI("http://baz.com/");
|
||||
var emptyuri = NetUtil.newURI("http:///");
|
||||
var doturi = NetUtil.newURI("http://./");
|
||||
do_check_eq(uri.asciiHost, "baz.com");
|
||||
do_check_eq(emptyuri.asciiHost, "");
|
||||
do_check_eq(doturi.asciiHost, ".");
|
||||
cs.setCookieString(emptyuri, null, "foo2=bar", null);
|
||||
do_check_eq(getCookieCount(), 0);
|
||||
cs.setCookieString(doturi, null, "foo3=bar", null);
|
||||
do_check_eq(getCookieCount(), 0);
|
||||
cs.setCookieString(uri, null, "foo=bar", null);
|
||||
do_check_eq(getCookieCount(), 1);
|
||||
|
||||
do_check_eq(cs.getCookieString(uri, null), "foo=bar");
|
||||
do_check_eq(cs.getCookieString(emptyuri, null), null);
|
||||
do_check_eq(cs.getCookieString(doturi, null), null);
|
||||
|
||||
do_check_eq(cm.countCookiesFromHost(""), 0);
|
||||
do_check_throws(function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue