forbid "undefined" cache value

This commit is contained in:
DIYgod 2018-11-19 11:43:08 +08:00
parent fff2032a81
commit 2257875db7
No known key found for this signature in database
GPG Key ID: EC0B76A252D3EF67
2 changed files with 2 additions and 2 deletions

View File

@ -26,7 +26,7 @@ module.exports = function(options = {}) {
}
},
set: (key, value, maxAge) => {
if (!value) {
if (!value || value === 'undefined') {
value = '';
}
if (typeof value === 'object') {

View File

@ -47,7 +47,7 @@ module.exports = function(options = {}) {
}
},
set: async (key, value, maxAge) => {
if (!value) {
if (!value || value === 'undefined') {
value = '';
}
if (typeof value === 'object') {