Bug 1495313 - Fix xhr/fetch tests to allow passwords with no username in URLs r=baku

Differential Revision: https://phabricator.services.mozilla.com/D11255

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Valentin Gosu 2018-11-14 19:11:02 +00:00
parent 1c5f254e6b
commit 31083cb05a
3 changed files with 4 additions and 8 deletions

View File

@ -88,7 +88,7 @@ window.addEventListener("message", function(e) {
try {
xhr.open(req.method, req.url, true,
("username" in req) ? req.username : "",
("password" in req) ? req.password : "aa");
("password" in req) ? req.password : "");
} catch (ex) {
res.didFail = true;
post(e, res);

View File

@ -83,9 +83,7 @@ function* runTest() {
},
// nonempty password
// XXXbz this passes for now, because we ignore passwords
// without usernames in most cases.
{ pass: 1,
{ pass: 0,
method: "GET",
noAllowPreflight: 1,
password: "password",
@ -762,7 +760,7 @@ function* runTest() {
is(res.responseText, "",
"wrong responseText in test for " + test.toSource());
if (!res.sendThrew) {
if (test.username) {
if (test.username || test.password) {
is(res.events.join(","),
"opening,rs1,sending,loadstart,rs4,error,loadend",
"wrong events in test for " + test.toSource());

View File

@ -180,9 +180,7 @@ function testModeCors() {
},
// nonempty password
// XXXbz this passes for now, because we ignore passwords
// without usernames in most cases.
{ pass: 1,
{ pass: 0,
method: "GET",
noAllowPreflight: 1,
password: "password",