From 11701f68a03159440c89a98093aca78eea632846 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 9 Aug 2018 18:47:29 -0400 Subject: [PATCH] Fix more tests after 6478a375e376 --- test/content/support.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/test/content/support.js b/test/content/support.js index 3d50e009bd..9370013712 100644 --- a/test/content/support.js +++ b/test/content/support.js @@ -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); + } }