serve 404 when not possible key

This commit is contained in:
John Crepezzi 2011-11-21 23:13:46 -05:00
parent 9ed330bdae
commit 32b4f842b7
3 changed files with 38 additions and 21 deletions

View file

@ -78,6 +78,11 @@ DocumentHandler.prototype.chooseKey = function(callback) {
});
};
// Return a boolean indicating whether or not something can be a key
DocumentHandler.potentialKey = function(key) {
return key.match(/^[a-zA-Z0-9]+$/);
};
// Generate a random key
DocumentHandler.prototype.randomKey = function() {
var text = '';