Skip to content

Commit

Permalink
Merge pull request #41 from D34THWINGS/fix-real-request-no-headers
Browse files Browse the repository at this point in the history
fix(request): Fixed request end method .toLowerCase() error
  • Loading branch information
D34THWINGS authored Nov 9, 2016
2 parents 1d64170 + b5c2dbc commit 55f0c46
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/superagent-mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function mock (superagent, config, logger) {
}

if (!parser) {
oldSet.call(this, this.headers);
oldSet.call(this, this.headers || {});
oldSend.call(this, this.params);

return oldEnd.call(this, fn);
Expand Down
3 changes: 2 additions & 1 deletion tests/support/expectations.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ module.exports = function (request, config) {
fn(null, 'Real call done');
};

var oldSet = request.Request.prototype.set;
request.Request.prototype.set = function (values) {
headers = values;

return this;
return oldSet.call(this, values);
};

// Init module
Expand Down

0 comments on commit 55f0c46

Please sign in to comment.