postman-collection
Advanced tools
Comparing version 0.4.10 to 0.4.11
@@ -53,2 +53,20 @@ var util = require('../util'), | ||
this.update(options); | ||
}), PropertyBase); | ||
_.extend(Header.prototype, /** @lends Header.prototype */ { | ||
/** | ||
* Converts the header to a single header string | ||
* @returns {String} | ||
*/ | ||
toString: function () { | ||
return this.key + ': ' + this.value; | ||
}, | ||
/** | ||
* Assigns the given properties to the Header | ||
* | ||
* @param options | ||
*/ | ||
update: function (options) { | ||
/** | ||
@@ -70,11 +88,9 @@ * The header Key | ||
_.has(options, 'system') && (this.system = options.system); | ||
}), PropertyBase); | ||
_.extend(Header.prototype, /** @lends Header.prototype */ { | ||
/** | ||
* Converts the header to a single header string | ||
* @returns {String} | ||
*/ | ||
toString: function () { | ||
return this.key + ': ' + this.value; | ||
/** | ||
* Indicates whether the header should be . | ||
* @type {*|boolean} | ||
* @todo figure out whether this should be in property.js | ||
*/ | ||
_.has(options, 'disabled') && (this.disabled = options.disabled); | ||
} | ||
@@ -81,0 +97,0 @@ }); |
@@ -61,3 +61,3 @@ var _ = require('../../util').lodash, | ||
body: request.body ? request.body.toString() : undefined, | ||
headers: _.transform(request.getHeaders(), function (accumulator, value, key) { | ||
headers: _.transform(request.getHeaders({ enabled: true }), function (accumulator, value, key) { | ||
if (!_.contains(NON_SIGNABLE_HEADERS, key.toLowerCase())) { | ||
@@ -64,0 +64,0 @@ accumulator[key] = value; |
@@ -68,4 +68,5 @@ var _ = require('../util').lodash, | ||
* | ||
* @param options | ||
* @param options {Object=} | ||
* @param options.ignoreCase {Boolean} When set to "true", will ensure that all the header keys are lower case. | ||
* @param options.enabled {Boolean} Only get the enabled headers | ||
* | ||
@@ -82,2 +83,3 @@ * @note If multiple headers are present in the same collection with same name, but different case | ||
_.forEach(self.headers.all(), function (header) { | ||
if (options.enabled && header.disabled) { return; } | ||
headers[options.ignoreCase ? header.key.toLowerCase() : header.key] = header.value; | ||
@@ -84,0 +86,0 @@ }); |
@@ -5,3 +5,3 @@ { | ||
"author": "Postman Labs <help@getpostman.com>", | ||
"version": "0.4.10", | ||
"version": "0.4.11", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "postman" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
279271
6334