Skip to content

Commit

Permalink
Use more robust Array instance check
Browse files Browse the repository at this point in the history
Improve robustness of Array type check.
  • Loading branch information
rubendg committed Sep 20, 2018
1 parent e910e85 commit 550613b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/test.js
Expand Up @@ -236,7 +236,7 @@ Test.prototype._assertHeader = function(header, res) {

if (typeof actual === 'undefined') return new Error('expected "' + field + '" header field');
// This check handles header values that may be a String or single element Array
if ((actual instanceof Array && actual.toString() === fieldExpected)
if ((Array.isArray(actual) && actual.toString() === fieldExpected)
|| fieldExpected === actual) {
return;
}
Expand Down

0 comments on commit 550613b

Please sign in to comment.