3
0
mirror of https://github.com/reality/dbot.git synced 2025-01-01 23:52:37 +01:00

lower case key

This commit is contained in:
Luke Slater 2011-09-15 12:34:01 +01:00
parent d3659eea6e
commit 9d0077b184

View File

@ -15,8 +15,9 @@ var webInterface = function(dbot) {
});
app.get('/quotes/:key', function(req, res) {
if(dbot.db.quoteArrs.hasOwnProperty(req.params.key)) {
res.render('quotes', { 'quotes': dbot.db.quoteArrs[req.params.key] });
var key = req.params.key.toLowerCase();
if(dbot.db.quoteArrs.hasOwnProperty(key)) {
res.render('quotes', { 'quotes': dbot.db.quoteArrs[key] });
} else {
res.render('error', { 'message': 'No quotes under that key.' });
}