postman-collection
Advanced tools
Comparing version 3.5.2 to 3.5.3
@@ -221,3 +221,12 @@ var _ = require('../util').lodash, | ||
valueOf: function () { | ||
return decodeURIComponent(this.value); | ||
// @todo: benchmark this (try-catch) v/s other decode-uri-component | ||
// modules or maybe add helper in postman-url-encoder. | ||
try { | ||
return decodeURIComponent(this.value); | ||
} | ||
// handle malformed URI sequence | ||
// refer: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Malformed_URI | ||
catch (error) { | ||
return this.value; | ||
} | ||
}, | ||
@@ -224,0 +233,0 @@ |
@@ -62,3 +62,17 @@ /* global btoa */ | ||
// Takes care of the case where the string is already encoded. | ||
return encodeURIComponent(decodeURIComponent(string)); | ||
try { | ||
string = decodeURIComponent(string); | ||
} | ||
catch (e) {} // eslint-disable-line no-empty | ||
// @todo: avoid using try-catch and instead add encode-decode helper | ||
// in postman-url-encoder. | ||
try { | ||
return encodeURIComponent(string); | ||
} | ||
// handle malformed URI sequence | ||
// refer: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Malformed_URI | ||
catch (error) { | ||
return string; | ||
} | ||
}, | ||
@@ -65,0 +79,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"author": "Postman Labs <help@getpostman.com>", | ||
"version": "3.5.2", | ||
"version": "3.5.3", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "postman" |
Sorry, the diff of this file is not supported yet
525927
11348