Stop adding safeFields to original options arg
This commit is contained in:
parent
e6126d1548
commit
936e2d4838
|
@ -35,8 +35,8 @@ module.exports = function buildResponseData(err, options) {
|
||||||
fillInternalError(data, err);
|
fillInternalError(data, err);
|
||||||
}
|
}
|
||||||
|
|
||||||
options.safeFields = options.safeFields || [];
|
var safeFields = options.safeFields || [];
|
||||||
fillSafeFields(data, err, options.safeFields);
|
fillSafeFields(data, err, safeFields);
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|
|
@ -626,6 +626,16 @@ describe('strong-error-handler', function() {
|
||||||
.expect('Content-Type', /^text\/html/, done);
|
.expect('Content-Type', /^text\/html/, done);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('does not modify "options" argument', function(done) {
|
||||||
|
var options = {log: false, debug: false};
|
||||||
|
givenErrorHandlerForError(new Error(), options);
|
||||||
|
request.get('/').end(function(err) {
|
||||||
|
if (err) return done(err);
|
||||||
|
expect(options).to.eql({log: false, debug: false});
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
var app, _requestHandler, request;
|
var app, _requestHandler, request;
|
||||||
|
|
Loading…
Reference in New Issue