Skip to content

Commit

Permalink
Merge pull request #425 from Optum/recorder-invo-hotfix
Browse files Browse the repository at this point in the history
Recorder + invo HOTFIX (STABLE)
  • Loading branch information
jdweeks authored Mar 21, 2019
2 parents 0db316f + 45853b7 commit 832e8fa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
12 changes: 8 additions & 4 deletions controllers/recorderController.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,15 @@ function stripRRPairForReq(rrpair) {

if(myRRPair.payloadType == "JSON"){
//Even if its supposed to be JSON, and it fails parsing- record it! This may be intentional from the user
try{
myRRPair.reqData = JSON.parse(req.body);
}catch(err){
if(typeof req.body == "string"){
try{
myRRPair.reqData = JSON.parse(req.body);
}catch(err){
myRRPair.reqData = req.body;
myRRPair.payloadType = "PLAIN";
}
}else{
myRRPair.reqData = req.body;
myRRPair.payloadType = "PLAIN";
}
}
else
Expand Down
12 changes: 8 additions & 4 deletions routes/invoke.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,15 @@ function createRRPairFromReqRes(req,res,service){
}
if(myRRPair.payloadType == "JSON"){
//Even if its supposed to be JSON, and it fails parsing- record it! This may be intentional from the user
try{
myRRPair.reqData = JSON.parse(req.body);
}catch(err){
if(typeof req.body == "string"){
try{
myRRPair.reqData = JSON.parse(req.body);
}catch(err){
myRRPair.reqData = req.body;
myRRPair.payloadType = "PLAIN";
}
}else{
myRRPair.reqData = req.body;
myRRPair.payloadType = "PLAIN";
}
}
else
Expand Down

0 comments on commit 832e8fa

Please sign in to comment.