Skip to content

Commit

Permalink
Merge pull request #3113 from danielb2/master
Browse files Browse the repository at this point in the history
test for strictHeader false
  • Loading branch information
hueniverse committed Apr 9, 2016
2 parents 8aef93a + 5d1b437 commit d870e6a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,26 @@ describe('state', () => {
});
});

it('ignores invalid cookie using server.state() (header)', (done) => {

const handler = function (request, reply) {

const log = request.getLog('state');
return reply(log.length);
};

const server = new Hapi.Server();
server.connection();
server.state('a', { strictHeader: false });
server.route({ path: '/', method: 'GET', handler: handler });
server.inject({ method: 'GET', url: '/', headers: { cookie: 'a=x y;' } }, (res) => {

expect(res.statusCode).to.equal(200);
expect(res.result).to.equal(0);
done();
});
});

it('logs invalid cookie (value)', (done) => {

const handler = function (request, reply) {
Expand Down

0 comments on commit d870e6a

Please sign in to comment.