Skip to content

Commit

Permalink
fix: nock.define() respects badheaders option
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m committed Sep 18, 2017
1 parent 9aa493a commit a82d4d4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/scope.js
Expand Up @@ -297,6 +297,7 @@ function define(nockDefs) {
, status = getStatusFromDefinition(nockDef)
, rawHeaders = nockDef.rawHeaders || []
, reqheaders = nockDef.reqheaders || {}
, badheaders = nockDef.badheaders || []
, body = nockDef.body || ''
, options = nockDef.options || {};

Expand All @@ -305,6 +306,7 @@ function define(nockDefs) {
// be changing the user's options object so we clone it first.
options = _.clone(options) || {};
options.reqheaders = reqheaders;
options.badheaders = badheaders;

// Response is not always JSON as it could be a string or binary data or
// even an array of binary buffers (e.g. when content is enconded)
Expand Down

0 comments on commit a82d4d4

Please sign in to comment.