Skip to content

Commit

Permalink
Merge pull request #1889 from akto-api-security/hotfix/null_check_pay…
Browse files Browse the repository at this point in the history
…load

Adding null check for payload
  • Loading branch information
ayushaga14 authored Jan 2, 2025
2 parents 96a9fc4 + d3a4a74 commit ad2ccd4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ const transform = {
})
}
finalData = finalData.split("\n").sort().join("\n");
const isPayloadEmpty = Object.keys(payLoad).length === 0
const isPayloadEmpty = payLoad === null || Object.keys(payLoad).length === 0
const isMultiformData = data?.json?.requestHeaders?.['content-type']?.includes('multipart/form-data')
return (localFirstLine + "\n" + finalData + (finalData.trim().length === 0 || isPayloadEmpty ? "\n" : "\n\n") + (!isPayloadEmpty ? (isMultiformData ? payLoad : this.formatJson(payLoad)) : ''))
}
Expand Down

0 comments on commit ad2ccd4

Please sign in to comment.