Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

curl-to-postmanv2

Package Overview
Dependencies
Maintainers
5
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

curl-to-postmanv2 - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

Curl

3

CHANGELOG.md
# cURL to Postman Importer Changelog
#### v1.1.2 (January 10, 2023)
* Changed regex to check for prefix space in url with query parameters for given curl string
#### v1.1.1 (June 2, 2022)

@@ -3,0 +6,0 @@ * Updated how error was handled in case of malformed URL.

2

package.json
{
"name": "curl-to-postmanv2",
"version": "1.1.1",
"version": "1.1.2",
"description": "Convert a given CURL command to a Postman request",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -478,8 +478,5 @@ const commander = require('commander'),

// [Github #8843] - RegEx to fix malformed cURLs with unquoted multi-param URLs
const multiParamUrlRegEx = /([^'` "\n]+)\.([^ \n]+)&((?!["'])[^ "`'\n])+($|(?=\s))/gm;
var cleanedCurlString = curlString.replace(multiParamUrlRegEx, `'${curlString.match(multiParamUrlRegEx)}'`),
sanitizedArgs = this.sanitizeArgs(cleanedCurlString),
curlObj = program.parse(sanitizedArgs),
var cleanedCurlString = curlString,
sanitizedArgs,
curlObj,
request = {},

@@ -496,2 +493,22 @@ basicAuthParts,

try {
sanitizedArgs = this.sanitizeArgs(cleanedCurlString);
curlObj = program.parse(sanitizedArgs);
}
catch (e) {
// [Github #8843] - RegEx to fix malformed cURLs with unquoted multi-param URLs
const multiParamUrlRegEx = /\s([^'` "\n]+)\.([^ \n]+)&((?!["'])[^ "`'\n])+($|(?=\s))/gm;
let matchedStrings = curlString.match(multiParamUrlRegEx),
matchedString = '',
prefixString = '';
if (matchedStrings && matchedStrings.length > 0) {
prefixString = matchedStrings[0].slice(0, 1);
matchedString = matchedStrings[0].slice(1);
}
cleanedCurlString = curlString.replace(multiParamUrlRegEx, `${prefixString}'${matchedString}'`);
sanitizedArgs = this.sanitizeArgs(cleanedCurlString);
curlObj = program.parse(sanitizedArgs);
}
this.headerPairs = {};

@@ -498,0 +515,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc