0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-01 02:41:39 -05:00

Ensured falsy values not returned from cache cookie

no-issue
This commit is contained in:
Fabien O'Carroll 2019-09-30 12:05:09 +07:00
parent ab4493db5f
commit 957a0df658

View file

@ -195,7 +195,11 @@ class MembersSSR {
return null;
}
try {
return JSON.parse(value);
const parsed = JSON.parse(value);
if (!parsed) {
throw new Error('Parsed value was falsy');
}
return parsed;
} catch (err) {
this._removeCacheCookie(req, res);
throw new BadRequestError({