From 3df13f7fee040bde22b415fb0cd64a3eade2cb78 Mon Sep 17 00:00:00 2001 From: Andris Reinman Date: Mon, 4 Sep 2017 14:49:04 +0300 Subject: [PATCH] allow longer cursors --- lib/api/addresses.js | 6 ++++-- lib/api/auth.js | 4 ++-- lib/api/messages.js | 10 ++++++---- lib/api/users.js | 10 ++++++---- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/lib/api/addresses.js b/lib/api/addresses.js index 460e5af5..9816976d 100644 --- a/lib/api/addresses.js +++ b/lib/api/addresses.js @@ -19,11 +19,13 @@ module.exports = (db, server) => { .min(1) .max(250), next: Joi.string() + .empty('') .alphanum() - .max(100), + .max(1024), prev: Joi.string() + .empty('') .alphanum() - .max(100), + .max(1024), page: Joi.number().default(1) }); diff --git a/lib/api/auth.js b/lib/api/auth.js index 42ead7f4..28135873 100644 --- a/lib/api/auth.js +++ b/lib/api/auth.js @@ -98,11 +98,11 @@ module.exports = (db, server, userHandler) => { next: Joi.string() .empty('') .alphanum() - .max(100), + .max(1024), previous: Joi.string() .empty('') .alphanum() - .max(100), + .max(1024), page: Joi.number() .empty('') .default(1) diff --git a/lib/api/messages.js b/lib/api/messages.js index b4e1424c..87daec8f 100644 --- a/lib/api/messages.js +++ b/lib/api/messages.js @@ -35,11 +35,11 @@ module.exports = (db, server, messageHandler) => { next: Joi.string() .empty('') .alphanum() - .max(100), + .max(1024), previous: Joi.string() .empty('') .alphanum() - .max(100), + .max(1024), page: Joi.number() .empty('') .default(1) @@ -249,11 +249,13 @@ module.exports = (db, server, messageHandler) => { .min(1) .max(250), next: Joi.string() + .empty('') .alphanum() - .max(100), + .max(1024), previous: Joi.string() + .empty('') .alphanum() - .max(100), + .max(1024), page: Joi.number().default(1) }); diff --git a/lib/api/users.js b/lib/api/users.js index bbe12170..ad58a071 100644 --- a/lib/api/users.js +++ b/lib/api/users.js @@ -15,20 +15,22 @@ module.exports = (db, server, userHandler) => { const schema = Joi.object().keys({ query: Joi.string() + .empty('') .alphanum() .lowercase() - .empty('') - .max(100), + .max(128), limit: Joi.number() .default(20) .min(1) .max(250), next: Joi.string() + .empty('') .alphanum() - .max(100), + .max(1024), previous: Joi.string() + .empty('') .alphanum() - .max(100), + .max(1024), page: Joi.number().default(1) });