mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 00:46:16 -04:00
SessionStore: Don't write DB record if already expired
This commit is contained in:
parent
4d498725c7
commit
b991948e21
2 changed files with 16 additions and 4 deletions
|
@ -46,6 +46,13 @@ describe(__filename, function () {
|
|||
await set(sess);
|
||||
assert.equal(JSON.stringify(await db.get(`sessionstorage:${sid}`)), JSON.stringify(sess));
|
||||
});
|
||||
|
||||
it('set of already expired session', async function () {
|
||||
const sess = {foo: 'bar', cookie: {expires: new Date(1)}};
|
||||
await set(sess);
|
||||
// No record should have been created.
|
||||
assert(await db.get(`sessionstorage:${sid}`) == null);
|
||||
});
|
||||
});
|
||||
|
||||
describe('get', function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue