We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8aef93a commit 5d1b437Copy full SHA for 5d1b437
test/state.js
@@ -116,6 +116,26 @@ describe('state', () => {
116
});
117
118
119
+ it('ignores invalid cookie using server.state() (header)', (done) => {
120
+
121
+ const handler = function (request, reply) {
122
123
+ const log = request.getLog('state');
124
+ return reply(log.length);
125
+ };
126
127
+ const server = new Hapi.Server();
128
+ server.connection();
129
+ server.state('a', { strictHeader: false });
130
+ server.route({ path: '/', method: 'GET', handler: handler });
131
+ server.inject({ method: 'GET', url: '/', headers: { cookie: 'a=x y;' } }, (res) => {
132
133
+ expect(res.statusCode).to.equal(200);
134
+ expect(res.result).to.equal(0);
135
+ done();
136
+ });
137
138
139
it('logs invalid cookie (value)', (done) => {
140
141
const handler = function (request, reply) {
0 commit comments