mirror of
https://github.com/seejohnrun/haste-server.git
synced 2025-12-14 03:15:54 +00:00
Clean up some code and move document stores into subfolder
This commit is contained in:
@@ -54,13 +54,15 @@ DocumentHandler.prototype.handlePost = function(request, response) {
|
||||
request.on('data', function(data) {
|
||||
if (!buffer) {
|
||||
response.writeHead(200, { 'content-type': 'application/json' });
|
||||
}
|
||||
}
|
||||
buffer += data.toString();
|
||||
if (_this.maxLength && buffer.length > _this.maxLength) {
|
||||
cancelled = true;
|
||||
winston.warn('document >maxLength', { maxLength: _this.maxLength });
|
||||
response.writeHead(400, { 'content-type': 'application/json' });
|
||||
response.end(JSON.stringify({ message: 'Document exceeds maximum length.' }));
|
||||
response.end(
|
||||
JSON.stringify({ message: 'Document exceeds maximum length.' })
|
||||
);
|
||||
}
|
||||
});
|
||||
request.on('end', function(end) {
|
||||
@@ -96,7 +98,7 @@ DocumentHandler.prototype.chooseKey = function(callback) {
|
||||
} else {
|
||||
callback(key);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
DocumentHandler.prototype.acceptableKey = function() {
|
||||
|
||||
Reference in New Issue
Block a user