Skip to content

Commit

Permalink
Fix for binary data representation when sending data through HTTP
Browse files Browse the repository at this point in the history
This PR fixes telefonicaid#690
  • Loading branch information
MayankSingh-NEC authored Jan 25, 2023
1 parent 36bcc64 commit ae243bd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/bindings/HTTPBinding.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function parseData(req, res, next) {
next(error);
} else {
req.jsonPayload = data;

data = Buffer.from(data).toJSON().data;
config.getLogger().debug(context, 'Parsed data: [%j]', data);
next();
}
Expand Down Expand Up @@ -313,6 +313,8 @@ function handleIncomingMeasure(req, res, next) {
} else {
for (const j in attributeArr) {
attributeValues = attributeArr[j];
attributeValues[0].value = Buffer.from(attributeValues[0].value).toJSON().data;
attributeArr[j][0].value = Buffer.from(attributeArr[j][0].value).toJSON().data;
config
.getLogger()
.debug(
Expand Down

0 comments on commit ae243bd

Please sign in to comment.