Comparing version 0.5.7 to 0.5.8
{ | ||
"name": "popsicle", | ||
"version": "0.5.7", | ||
"version": "0.5.8", | ||
"description": "Simple HTTP requests for node and the browser", | ||
@@ -5,0 +5,0 @@ "main": "popsicle.js", |
@@ -569,3 +569,3 @@ /* global define */ | ||
Object.keys(req.headers).forEach(function (key) { | ||
headers[req.name(key)] = req.headers[key] | ||
headers[req.name(key)] = req.get(key) | ||
}) | ||
@@ -797,4 +797,9 @@ | ||
this.headers[lower] = value | ||
this.headerNames[lower] = key | ||
if (value == null) { | ||
delete this.headers[lower] | ||
delete this.headerNames[lower] | ||
} else { | ||
this.headers[lower] = value | ||
this.headerNames[lower] = key | ||
} | ||
@@ -839,3 +844,3 @@ return this | ||
Headers.prototype.get = function (header) { | ||
if (header == null) { | ||
if (arguments.length === 0) { | ||
return getHeaders(this) | ||
@@ -869,7 +874,7 @@ } | ||
Headers.prototype.type = function (value) { | ||
if (value) { | ||
return this.set('Content-Type', value) | ||
if (arguments.length === 0) { | ||
return type(this.headers['content-type']) | ||
} | ||
return type(this.headers['content-type']) | ||
return this.set('Content-Type', value) | ||
} | ||
@@ -876,0 +881,0 @@ |
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
53264
1347