This PR fixes issue where for certain cURL were converted incorrectly. For example, below cURL imported successfully with incorrect URL and name being object rather than failing as it's invalid cURL. i.e. executing this command will provide following error in bash.
➜ ~ curl -X POST -H 'Content-type: application/json' #{reply_url} --data '#{response.to_json}'
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information
RCA
issue was happening due to incorrect handling of curlObj.args whenever comments were present. We're simply assigning curlObj.args[0] directly as a request URL. Which created object for URL which is incorrect as it should be string.
Fix
We'll be filtering out any comments found in the curlObj.args and also making sure we only assign string values to request URL.
Overview
This PR fixes issue where for certain cURL were converted incorrectly. For example, below cURL imported successfully with incorrect URL and name being object rather than failing as it's invalid cURL. i.e. executing this command will provide following error in bash.
RCA
issue was happening due to incorrect handling of
curlObj.args
whenever comments were present. We're simply assigningcurlObj.args[0]
directly as a request URL. Which created object for URL which is incorrect as it should be string.Fix
We'll be filtering out any comments found in the
curlObj.args
and also making sure we only assign string values to request URL.