From 4f1824c271a1f679167e89f69346ef32bf708d1c Mon Sep 17 00:00:00 2001 From: ivaosthu Date: Thu, 29 Jun 2017 11:10:24 +0200 Subject: [PATCH] Strip uknown fields in client requests. closes #245 --- lib/routes/client-api/metrics-schema.js | 2 +- lib/routes/client-api/register-schema.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/routes/client-api/metrics-schema.js b/lib/routes/client-api/metrics-schema.js index 12dedc6262..4c25ade26a 100644 --- a/lib/routes/client-api/metrics-schema.js +++ b/lib/routes/client-api/metrics-schema.js @@ -2,7 +2,7 @@ const joi = require('joi'); -const clientMetricsSchema = joi.object().keys({ +const clientMetricsSchema = joi.object().options({ stripUnknown: true }).keys({ appName: joi.string().required(), instanceId: joi.string().required(), bucket: joi.object().required().keys({ diff --git a/lib/routes/client-api/register-schema.js b/lib/routes/client-api/register-schema.js index e133e03598..99efd62488 100644 --- a/lib/routes/client-api/register-schema.js +++ b/lib/routes/client-api/register-schema.js @@ -2,7 +2,7 @@ const joi = require('joi'); -const clientRegisterSchema = joi.object().keys({ +const clientRegisterSchema = joi.object().options({ stripUnknown: true }).keys({ appName: joi.string().required(), instanceId: joi.string().required(), sdkVersion: joi.string().optional(),