@itentialopensource/adapter-utils
Advanced tools
Comparing version 5.3.9 to 5.3.10
## 5.3.10 [03-06-2024] | ||
* Fix some security vulnerabilities | ||
See merge request itentialopensource/adapter-utils!289 | ||
--- | ||
## 5.3.9 [03-04-2024] | ||
@@ -3,0 +11,0 @@ |
@@ -145,5 +145,36 @@ /* @copyright Itential, LLC 2018 */ | ||
// copy the request so lint does not complain about update | ||
const newReqObj = request; | ||
// this is only something in Form data with files | ||
if (entitySchema && entitySchema.requestDatatype && entitySchema.requestDatatype.toUpperCase() === 'FORM') { | ||
// need to convert request.body back to JSON | ||
let mybody = newReqObj.body; | ||
if (typeof mybody === 'string') { | ||
try { | ||
mybody = JSON.parse(newReqObj.body); | ||
} catch (ex) { | ||
log.debug('Rest Handler can not parse Form Body'); | ||
} | ||
} | ||
// set the filePath into the request object | ||
const mykeys = Object.keys(mybody); | ||
for (let k = 0; k < mykeys.length; k += 1) { | ||
if (mykeys[k] === 'file') { | ||
const itemVal = mybody[mykeys[k]]; | ||
if ((typeof itemVal === 'string') && (itemVal.indexOf('@') === 0)) { | ||
const fileVal = itemVal; | ||
if (fileVal.indexOf('@') === 0) { | ||
const filePart = fileVal.split(';'); | ||
newReqObj.filePath = filePart[0].substring(1); | ||
} | ||
} | ||
break; | ||
} | ||
} | ||
} | ||
try { | ||
// perform the request to get entity(ies) | ||
return connectorInst.performRequest(request, entitySchema, callProperties, (resObj, perror) => { | ||
return connectorInst.performRequest(newReqObj, entitySchema, callProperties, (resObj, perror) => { | ||
if (perror) { | ||
@@ -223,9 +254,9 @@ let retError = null; | ||
const responseKeys = entitySchema.responseObjects; | ||
const uriPath = request.origPath; | ||
const method = request.method.toUpperCase(); | ||
const reqBody = request.body; | ||
const reqPath = request.path; | ||
const uriPath = newReqObj.origPath; | ||
const method = newReqObj.method.toUpperCase(); | ||
const reqBody = newReqObj.body; | ||
const reqPath = newReqObj.path; | ||
// if there is a request body, see if there is something that matches a specific input | ||
if (reqBody && (!entitySchema || !entitySchema.requestDatatype | ||
if (reqBody && (typeof reqBody === 'string') && (!entitySchema || !entitySchema.requestDatatype | ||
|| entitySchema.requestDatatype.toUpperCase() === 'JSON' || entitySchema.requestDatatype.toUpperCase() === 'URLENCODE')) { | ||
@@ -232,0 +263,0 @@ let reqBdObj = null; |
{ | ||
"name": "@itentialopensource/adapter-utils", | ||
"version": "5.3.9", | ||
"version": "5.3.10", | ||
"description": "Itential Adapter Utility Libraries", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
806845
16210