postman-code-generators
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -0,1 +1,4 @@ | ||
v1.0.1 (Jun 29, 2020) | ||
- Fix for - [8674](https://github.com/postmanlabs/postman-app-support/issues/8674): Add URL sanitization for quotes in cURL, Java Unirest, NodeJS Native, Python http.client, and Swift. | ||
v1.0.0 (May 29, 2020) | ||
@@ -2,0 +5,0 @@ - Add axios framework support |
@@ -1,2 +0,2 @@ | ||
module.exports = { | ||
var self = module.exports = { | ||
/** | ||
@@ -152,3 +152,3 @@ * sanitizes input string by handling escape characters eg: converts '''' to '\'\'' | ||
return url; | ||
return self.sanitize(url); | ||
}, | ||
@@ -155,0 +155,0 @@ |
@@ -43,3 +43,3 @@ var _ = require('./lodash'), | ||
return url; | ||
return sanitize(url); | ||
} | ||
@@ -46,0 +46,0 @@ |
@@ -212,3 +212,3 @@ const _ = require('./lodash'), | ||
if (pathArray && pathArray.length) { | ||
pathSnippet += sanitize(_.reduce(pathArray, function (accumalator, key) { | ||
pathSnippet += (_.reduce(pathArray, function (accumalator, key) { | ||
if (key.length) { | ||
@@ -215,0 +215,0 @@ accumalator.push(`${sanitize(key)}`); |
@@ -45,3 +45,3 @@ var _ = require('./lodash'), | ||
function getUrlPathWithQuery (requestUrl) { | ||
var path = requestUrl.getPath(), | ||
var path = sanitize(requestUrl.getPath()), | ||
query = requestUrl.getQueryString({ ignoreDisabled: true }), | ||
@@ -135,3 +135,3 @@ urlPathWithQuery = ''; | ||
snippet += 'import mimetypes\n'; | ||
snippet += `conn = http.client.HTTPSConnection("${request.url.host ? request.url.host.join('.') : ''}"`; | ||
snippet += `conn = http.client.HTTPSConnection("${sanitize(request.url.host ? request.url.host.join('.') : '')}"`; | ||
snippet += request.url.port ? `, ${request.url.port}` : ''; | ||
@@ -138,0 +138,0 @@ snippet += options.requestTimeout !== 0 ? `, timeout = ${options.requestTimeout})\n` : ')\n'; |
@@ -142,3 +142,3 @@ /** | ||
return url; | ||
return sanitize(url, 'url'); | ||
} | ||
@@ -145,0 +145,0 @@ |
{ | ||
"name": "postman-code-generators", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Generates code snippets for a postman collection", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
1310124
384
34475