Skip to content

Commit

Permalink
move JSON.stringify to python helper
Browse files Browse the repository at this point in the history
  • Loading branch information
Fr0stM0urne committed Mar 28, 2024
1 parent 13fe580 commit f87737e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/targets/python/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ module.exports = {
if (value === null || value === undefined) {
return ''
}
return '"' + value.toString().replace(/"/g, '\\"') + '"'
return JSON.stringify(value)
}
}
}
2 changes: 1 addition & 1 deletion src/targets/python/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module.exports = function (source, options) {
switch (source.postData.mimeType) {
case 'application/json':
if (source.postData.jsonObj) {
code.push('payload = %s', JSON.stringify(source.postData.jsonObj))
code.push('payload = %s', helpers.literalRepresentation(source.postData.jsonObj, opts))
jsonPayload = true
hasPayload = true
}
Expand Down

0 comments on commit f87737e

Please sign in to comment.