Comparing version 2.1.0 to 2.1.1
@@ -54,3 +54,3 @@ // | ||
if (!header) return {}; | ||
header = (header instanceof Array) ? header : [header]; | ||
header = Array.isArray(header) ? header : [header]; | ||
@@ -78,2 +78,2 @@ return header.reduce(function(res, str) { | ||
// writes a cookie string header | ||
exports.write = writeCookieString; | ||
exports.write = writeCookieString; |
@@ -124,5 +124,7 @@ ////////////////////////////////////////// | ||
var charset = 'iso-8859-1', arr = header.split(';'); | ||
try { charset = arr[1].match(/charset=(.+)/)[1] } catch (e) { /* not found */ } | ||
var found, charset = 'iso-8859-1', arr = header.split(';'); | ||
if (arr.length > 1 && (found = arr[1].match(/charset=(.+)/))) | ||
charset = found[1]; | ||
return { type: arr[0], charset: charset }; | ||
@@ -129,0 +131,0 @@ } |
{ | ||
"name": "needle", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "The leanest and most handsome HTTP client in the Nodelands.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
225046
4575