undefined session values should return undefined
it was returning null
This commit is contained in:
Родитель
c4f4fda169
Коммит
962c4eab6f
|
@ -218,7 +218,7 @@ Session.prototype = {
|
|||
} else {
|
||||
if (!raw_session.loaded) {
|
||||
var didLoad = raw_session.loadFromCookie();
|
||||
if (!didLoad) return null;
|
||||
if (!didLoad) return undefined;
|
||||
}
|
||||
return this.target[name];
|
||||
}
|
||||
|
|
|
@ -225,16 +225,18 @@ suite.addBatch({
|
|||
var app = create_app();
|
||||
|
||||
app.get("/foo", function(req, res) {
|
||||
// this should send undefined, not null
|
||||
res.send(req.session.foo);
|
||||
});
|
||||
|
||||
var browser = tobi.createBrowser(app);
|
||||
browser.get("/foo", function(res, $) {
|
||||
self.callback(null, res);
|
||||
self.callback(null, res, $);
|
||||
});
|
||||
},
|
||||
"does not set a cookie": function(err, res) {
|
||||
"does not set a cookie": function(err, res, body) {
|
||||
assert.isUndefined(res.headers['set-cookie']);
|
||||
assert.isUndefined(body);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче