The .set function is not loyal to the superagent implementation
elisherer opened this issue · 3 comments
The oldSet function call under .end passes an object (this.headers) which in superagent's implementation does a for loop to insert them (by calling the set with key and value), but in superagent, this.set refers to the mock client set function which makes no difference to the internal state.
The side effect is that type() and set() don't work when using mock.
hope it's clear.
Yes, it is thanks. We need an implementation of the type
function. Would you make a pull request 😃 ?
Sure, but i think a different approach should be taken.
Implement only end and abort (removing set and send) which only used for logging.
And use this._data and this._header instead for the currentLog. The internal implementation of superagent is assumed anyway, no need to collect information on the go.
I see, it's even better !