Skip to content

Commit

Permalink
Merge branch 'master' into task/send_update_for_multimeasure
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvaroVega authored May 7, 2024
2 parents 0309fa4 + 0f5e3a0 commit 847a0a6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- Fix: allow send multiple measures to CB in a batch (v2/op/update) instead of using multiples single request (iotagent-json#825)
- Fix: default express limit to 1Mb instead default 100Kb and allow change it throught a conf env var 'IOTA_EXPRESS_LIMIT' (#827)
12 changes: 6 additions & 6 deletions lib/bindings/HTTPBinding.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ let httpBindingServer;
const transport = 'HTTP';

const { promisify } = require('util');
const json = promisify(bodyParser.json({ strict: false })); // accept anything JSON.parse accepts.
const text = promisify(bodyParser.text());
const raw = promisify(bodyParser.raw());
const json = promisify(bodyParser.json({ strict: false, limit: config.getConfig().iota.expressLimit })); // accept anything JSON.parse accepts.
const text = promisify(bodyParser.text({ limit: config.getConfig().iota.expressLimit }));
const raw = promisify(bodyParser.raw({ limit: config.getConfig().iota.expressLimit }));
const xml2js = require('xml2js');
const xmlStripPrefix = xml2js.processors.stripPrefix;
const xml = promisify(
Expand Down Expand Up @@ -674,7 +674,7 @@ function start(callback) {

httpBindingServer.router.post(
config.getConfig().iota.defaultResource || constants.HTTP_MEASURE_PATH,
bodyParser.json({ strict: false }), // accept anything JSON.parse accepts
bodyParser.json({ strict: false, limit: config.getConfig().iota.expressLimit }), // accept anything JSON.parse accepts
checkMandatoryParams(false),
parseDataMultipleMeasure,
addTimestamp,
Expand All @@ -697,7 +697,7 @@ function start(callback) {

httpBindingServer.router.post(
(config.getConfig().iota.defaultResource || constants.HTTP_MEASURE_PATH) + constants.HTTP_COMMANDS_PATH,
bodyParser.json({ strict: false }), // accept anything JSON.parse accepts.
bodyParser.json({ strict: false, limit: config.getConfig().iota.expressLimit }), // accept anything JSON.parse accepts.
checkMandatoryParams(false),
parseData,
addTimestamp,
Expand All @@ -708,7 +708,7 @@ function start(callback) {

httpBindingServer.router.post(
(config.getConfig().iota.defaultResource || constants.HTTP_MEASURE_PATH) + constants.HTTP_CONFIGURATION_PATH,
bodyParser.json({ strict: false }), // accept anything JSON.parse accepts.
bodyParser.json({ strict: false, limit: config.getConfig().iota.expressLimit }), // accept anything JSON.parse accepts.
checkMandatoryParams(false),
parseData,
handleConfigurationRequest
Expand Down

0 comments on commit 847a0a6

Please sign in to comment.