curl-to-postmanv2
Advanced tools
Comparing version 1.3.0 to 1.4.0
# cURL to Postman Importer Changelog | ||
#### v1.4.0 (March 17, 2023) | ||
* Fixed issue [#7895](https://github.com/postmanlabs/postman-app-support/issues/7895) where cURL with no specific method defined for formdata type of body were not converted correctly. | ||
#### v1.3.0 (March 02, 2023) | ||
@@ -4,0 +7,0 @@ * Fix for [#8087](https://github.com/postmanlabs/postman-app-support/issues/8087) - Add support to convert digest and NTLM auth types |
{ | ||
"name": "curl-to-postmanv2", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "Convert a given CURL command to a Postman request", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -85,3 +85,4 @@ const commander = require('commander'), | ||
else if (curlObj.data.length > 0 || curlObj.dataAscii.length > 0 || | ||
curlObj.dataUrlencode.length > 0 || curlObj.dataRaw.length > 0 || curlObj.dataBinary) { | ||
curlObj.dataUrlencode.length > 0 || curlObj.dataRaw.length > 0 || | ||
curlObj.dataBinary || curlObj.form.length > 0) { | ||
return 'POST'; | ||
@@ -578,3 +579,4 @@ } | ||
dataUrlencode, | ||
formData; | ||
formData, | ||
isMethodGuessed = false; | ||
@@ -606,2 +608,3 @@ try { | ||
curlObj.request = this.getRequestMethod(curlObj); | ||
isMethodGuessed = true; | ||
} | ||
@@ -691,2 +694,8 @@ | ||
request.body.formdata = this.parseFormBoundryData(formData, content_type); | ||
/** | ||
* As we are parsing raw args here to detect form-data body, make sure we are also | ||
* defining method if not already defined in cURL | ||
*/ | ||
(!_.isEmpty(request.body.formdata) && isMethodGuessed) && (request.method = 'POST'); | ||
} | ||
@@ -693,0 +702,0 @@ |
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
71839
20
1208