mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
parent
f4436644a9
commit
c6a4ca7cd1
1 changed files with 39 additions and 0 deletions
39
src/server/http/__tests__/index.js
Normal file
39
src/server/http/__tests__/index.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
import expect from 'expect.js';
|
||||
import KbnServer from '../../KbnServer';
|
||||
|
||||
describe('cookie validation', function () {
|
||||
let kbnServer;
|
||||
beforeEach(function () {
|
||||
kbnServer = new KbnServer();
|
||||
return kbnServer.ready();
|
||||
});
|
||||
afterEach(function () {
|
||||
return kbnServer.close();
|
||||
});
|
||||
|
||||
it('allows non-strict cookies', function (done) {
|
||||
kbnServer.server.inject({
|
||||
method: 'GET',
|
||||
url: '/',
|
||||
headers: {
|
||||
cookie: 'test:80=value;test_80=value'
|
||||
}
|
||||
}, (res) => {
|
||||
expect(res.payload).not.to.contain('Invalid cookie header');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('returns an error if the cookie can\'t be parsed', function (done) {
|
||||
kbnServer.server.inject({
|
||||
method: 'GET',
|
||||
url: '/',
|
||||
headers: {
|
||||
cookie: 'a'
|
||||
}
|
||||
}, (res) => {
|
||||
expect(res.payload).to.contain('Invalid cookie header');
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue