postman-collection
Advanced tools
Comparing version 3.4.7 to 3.4.8-beta.1
var _ = require('../util').lodash, | ||
Property = require('./property').Property, | ||
nodeUrl = require('url'), | ||
Url = require('./url').Url, | ||
@@ -12,7 +11,7 @@ UrlMatchPattern = require('../url-pattern/url-match-pattern').UrlMatchPattern, | ||
PROTOCOL_HOST_SEPARATOR = '://', | ||
MATCH_ALL_HOST_AND_PATH = '*/*', | ||
MATCH_ALL_HOST_AND_PATH = '*:*/*', | ||
AUTH_CREDENTIALS_SEPARATOR = '@', | ||
DEFAULT_PROTOCOL = 'http', | ||
ALLOWED_PROTOCOLS = ['http', 'https'], | ||
// 'http+https://*/*' | ||
// 'http+https://*:*/*' | ||
DEFAULT_PATTERN = ALLOWED_PROTOCOLS.join(PROTOCOL_DELIMITER) + PROTOCOL_HOST_SEPARATOR + MATCH_ALL_HOST_AND_PATH; | ||
@@ -140,5 +139,5 @@ | ||
if (_.isString(options.host)) { | ||
parsedUrl = nodeUrl.parse(options.host); | ||
// we want to strip the protocol, but if protocol is not present then parsedUrl.hostname will be null | ||
this.host = parsedUrl.protocol ? parsedUrl.hostname : options.host; | ||
// strip the protocol from given host | ||
parsedUrl = new Url(options.host); | ||
this.host = parsedUrl.getHost(); | ||
} | ||
@@ -189,3 +188,3 @@ | ||
test: function (urlStr) { | ||
var protocol = Url.isUrl(urlStr) ? urlStr.protocol : _.trimEnd(nodeUrl.parse(urlStr || E).protocol || E, COLON); | ||
var protocol = Url.isUrl(urlStr) ? urlStr.protocol : (Url.parse(urlStr || E).protocol || E); | ||
@@ -192,0 +191,0 @@ // to allow target URLs without any protocol. e.g.: 'foo.com/bar' |
@@ -409,2 +409,3 @@ var _ = require('../util').lodash, | ||
var pathVariables, | ||
pathVariableKeys = {}, | ||
p = { | ||
@@ -459,4 +460,8 @@ raw: url | ||
pathVariables = _.transform(p.path, function (res, segment) { | ||
// check if the segment has path variable prefix followed by the variable name. | ||
if (_.startsWith(segment, PATH_VARIABLE_IDENTIFIER) && segment !== PATH_VARIABLE_IDENTIFIER) { | ||
// check if the segment has path variable prefix followed by the variable name and | ||
// the variable is not already added in the list. | ||
if (_.startsWith(segment, PATH_VARIABLE_IDENTIFIER) && | ||
segment !== PATH_VARIABLE_IDENTIFIER && | ||
!pathVariableKeys[segment]) { | ||
pathVariableKeys[segment] = true; | ||
res.push({ key: segment.slice(1) }); // remove path variable prefix. | ||
@@ -463,0 +468,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"author": "Postman Labs <help@getpostman.com>", | ||
"version": "3.4.7", | ||
"version": "3.4.8-beta.1", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "postman" |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
495959
76
10584
1