@opengis/fastify-table 2.5.2 → 2.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -164,11 +164,11 @@ async function plugin(fastify) {
|
|
|
164
164
|
if (config.dblist) {
|
|
165
165
|
fastify.register(dblistRoutes, opt);
|
|
166
166
|
}
|
|
167
|
-
fastify.addHook('
|
|
167
|
+
fastify.addHook('preHandler', async (request, reply) => {
|
|
168
168
|
const q = request.query;
|
|
169
169
|
if (q?.limit !== undefined) {
|
|
170
170
|
const limit = Number(q.limit);
|
|
171
|
-
if (!Number.isInteger(limit) || limit < 1 || limit >
|
|
171
|
+
if (!Number.isInteger(limit) || limit < 1 || limit > 1000) {
|
|
172
172
|
reply.code(400).send({
|
|
173
173
|
error: 'Invalid limit (1-100)'
|
|
174
174
|
});
|
|
@@ -184,9 +184,9 @@ async function plugin(fastify) {
|
|
|
184
184
|
}
|
|
185
185
|
if (q?.page !== undefined) {
|
|
186
186
|
const page = Number(q.page);
|
|
187
|
-
if (!Number.isInteger(page) || page >
|
|
187
|
+
if (!Number.isInteger(page) || page > 100000) {
|
|
188
188
|
reply.code(400).send({
|
|
189
|
-
error: 'Invalid page (<=
|
|
189
|
+
error: 'Invalid page (<=100000)'
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
192
|
}
|