Fix WebDAV tests after 276bb99fc9
This commit is contained in:
parent
1274d5a4fe
commit
6478a375e3
2 changed files with 14 additions and 4 deletions
|
@ -894,7 +894,7 @@ function importHTMLAttachment() {
|
|||
* that defines the response
|
||||
* @param {Object} responses - Predefined responses
|
||||
*/
|
||||
function setHTTPResponse(server, baseURL, response, responses) {
|
||||
function setHTTPResponse(server, baseURL, response, responses, username, password) {
|
||||
if (typeof response == 'string') {
|
||||
let [topic, key] = response.split('.');
|
||||
if (!responses[topic]) {
|
||||
|
@ -924,5 +924,12 @@ function setHTTPResponse(server, baseURL, response, responses) {
|
|||
responseArray[1][i] = response.headers[i];
|
||||
}
|
||||
|
||||
server.respondWith(response.method, baseURL + response.url, responseArray);
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue