fix(xo-server/api): throw on unexpected parameters

This commit is contained in:
Julien Fontanet
2019-06-06 18:11:12 +02:00
parent d641d35d5c
commit b8524732ce
2 changed files with 3 additions and 1 deletions

View File

@@ -183,6 +183,7 @@ getLogs.params = {
after: { type: ['number', 'string'], optional: true },
before: { type: ['number', 'string'], optional: true },
limit: { type: 'number', optional: true },
'*': { type: 'any' },
}
// -----------------------------------------------------------------------------

View File

@@ -60,8 +60,9 @@ function checkParams(method, params) {
const result = schemaInspector.validate(
{
type: 'object',
properties: schema,
strict: true,
type: 'object',
},
params
)