postmanlabs / curl-to-postman

Converts curl requests to Postman Collection v2 request objects
Apache License 2.0
65 stars 31 forks source link

Fixes #8433 - non-apostrophed ('...') url with multiple params support in cURL import #48

Closed SahilChoudhary22 closed 2 years ago

SahilChoudhary22 commented 2 years ago
SahilChoudhary22 commented 2 years ago
umeshp7 commented 2 years ago

We should add additional handling for trailing & in the URL which is not accounted for in the current regex.

umeshp7 commented 2 years ago

We should add a safe check at arg.startsWith('$') as well. And throw appropriate errors where necessary. Because we won't be able to handle all cases. And there can be malformed curls as well. the current message "t.startsWith is not a function" is not a friendly message

If this & is still encountered after the handling like for example for:curl https://postman-echo.com/post -d foo1=bar1&foo2=bar2 these are clearly invalid. Then we should respond with an error saying "Please check your curl for unsanitised & character" or something similar.

umeshp7 commented 2 years ago

@SahilChoudhary22 Looks good to me. Let's merge this and we can test this one beta.