mirror of
https://github.com/seejohnrun/haste-server.git
synced 2025-12-13 21:35:56 +00:00
Remove hashlib dependency and switch to mocha for testing
This commit is contained in:
@@ -86,9 +86,9 @@ DocumentHandler.prototype.handlePost = function(request, response) {
|
||||
});
|
||||
};
|
||||
|
||||
// Get a random key that hasn't been already used
|
||||
// Keep choosing keys until one isn't taken
|
||||
DocumentHandler.prototype.chooseKey = function(callback) {
|
||||
var key = this.keyGenerator.createKey(this.keyLength);
|
||||
var key = this.acceptableKey();
|
||||
var _this = this;
|
||||
this.store.get(key, function(ret) {
|
||||
if (ret) {
|
||||
@@ -99,4 +99,8 @@ DocumentHandler.prototype.chooseKey = function(callback) {
|
||||
});
|
||||
};
|
||||
|
||||
DocumentHandler.prototype.acceptableKey = function() {
|
||||
return this.keyGenerator.createKey(this.keyLength);
|
||||
};
|
||||
|
||||
module.exports = DocumentHandler;
|
||||
|
||||
Reference in New Issue
Block a user