Fix more tests after 6478a375e3

This commit is contained in:
Dan Stillman 2018-08-09 18:47:29 -04:00
parent 6478a375e3
commit 11701f68a0

View file

@ -924,12 +924,17 @@ function setHTTPResponse(server, baseURL, response, responses, username, passwor
responseArray[1][i] = response.headers[i];
}
server.respondWith(function (req) {
if (username && req.username != username) return;
if (password && req.password != password) return;
if (req.method == response.method && req.url == baseURL + response.url) {
req.respond(...responseArray);
}
});
if (username || password) {
server.respondWith(function (req) {
if (username && req.username != username) return;
if (password && req.password != password) return;
if (req.method == response.method && req.url == baseURL + response.url) {
req.respond(...responseArray);
}
});
}
else {
server.respondWith(response.method, baseURL + response.url, responseArray);
}
}