Merge pull request #1 from seejohnrun/master

Repo sync
This commit is contained in:
Vitaly Novichkov 2017-03-18 17:33:17 +03:00 committed by GitHub
commit f987c64e06
1 changed files with 4 additions and 7 deletions

View File

@ -114,8 +114,8 @@ if (config.rateLimits) {
app.use(route(function(router) { app.use(route(function(router) {
// get raw documents - support getting with extension // get raw documents - support getting with extension
router.get('/raw/:id', function(request, response, next) { router.get('/raw/:id', function(request, response, next) {
var skipExpire = !!config.documents[request.params.id];
var key = request.params.id.split('.')[0]; var key = request.params.id.split('.')[0];
var skipExpire = !!config.documents[key];
return documentHandler.handleRawGet(key, response, skipExpire); return documentHandler.handleRawGet(key, response, skipExpire);
}); });
// add documents // add documents
@ -124,12 +124,9 @@ app.use(route(function(router) {
}); });
// get documents // get documents
router.get('/documents/:id', function(request, response, next) { router.get('/documents/:id', function(request, response, next) {
var skipExpire = !!config.documents[request.params.id]; var key = request.params.id.split('.')[0];
return documentHandler.handleGet( var skipExpire = !!config.documents[key];
request.params.id, return documentHandler.handleGet(key, response, skipExpire);
response,
skipExpire
);
}); });
})); }));