Skip to content

Commit

Permalink
Demonstrate integration issue with querystring
Browse files Browse the repository at this point in the history
The result of querystring.parse(), ParsedQueryString,
does not inherit from Object.prototype, causing a type error
"hasOwnProperty is not a function.  This test demonstrates that problem
as reported in pull request #77 "Fix body field extractor"
  • Loading branch information
mikenicholson committed Oct 31, 2016
1 parent ad990e8 commit ec6946e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/extrators-test.js
Expand Up @@ -59,6 +59,17 @@ describe('Token extractor', function() {

expect(token).to.equal('abcd123');
});


it('should work properly with querystring', function() {
var req = new Request();
const querystring = require('querystring');
req.body = querystring.parse('test_field=abcd123')

var token = extractor(req);

expect(token).to.equal('abcd123')
});
});


Expand Down

0 comments on commit ec6946e

Please sign in to comment.