Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tests: add test for empty list of exposed headers
  • Loading branch information
dougwilson committed Mar 26, 2017
1 parent f66e8a0 commit 72e7517
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/cors.js
Expand Up @@ -564,6 +564,24 @@
cors(options)(req, res, next);
});

it('specifying an empty list or string of exposed headers will result in no response header for exposed headers', function (done) {
// arrange
var req, res, next, options;
options = {
exposedHeaders: []
};
req = fakeRequest();
res = fakeResponse();
next = function () {
// assert
should.not.exist(res.getHeader('Access-Control-Expose-Headers'));
done();
};

// act
cors(options)(req, res, next);
});

it('includes credentials if explicitly enabled', function (done) {
// arrange
var req, res, options;
Expand Down

0 comments on commit 72e7517

Please sign in to comment.