mirror of
https://github.com/zebrajr/express.git
synced 2025-12-06 00:19:48 +01:00
Fixed app.set() with undefined
This commit is contained in:
parent
b4ce57caec
commit
7d24c2ba40
|
|
@ -332,7 +332,7 @@ app.is = function(type, fn){
|
|||
*/
|
||||
|
||||
app.set = function(setting, val){
|
||||
if (val === undefined) {
|
||||
if (1 == arguments.length) {
|
||||
if (this.settings.hasOwnProperty(setting)) {
|
||||
return this.settings[setting];
|
||||
} else if (this.parent) {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,11 @@ describe('config', function(){
|
|||
var app = express();
|
||||
app.set('foo', 'bar').should.equal(app);
|
||||
})
|
||||
|
||||
it('should return the app when undefined', function(){
|
||||
var app = express();
|
||||
app.set('foo', undefined).should.equal(app);
|
||||
})
|
||||
})
|
||||
|
||||
describe('.get()', function(){
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user