Comparing version 2.17.0 to 2.17.1
@@ -0,1 +1,6 @@ | ||
2.17.1 / 2014-05-21 | ||
=================== | ||
* fix `res.charset` appending charset when `content-type` has one | ||
2.17.0 / 2014-05-20 | ||
@@ -2,0 +7,0 @@ =================== |
@@ -126,3 +126,3 @@ | ||
if ('content-type' == key && this.charset) { | ||
val += '; charset=' + this.charset; | ||
val = utils.setCharset(val, this.charset, true); | ||
} | ||
@@ -129,0 +129,0 @@ |
@@ -22,3 +22,10 @@ | ||
// pause is broken in node < 0.10 | ||
/** | ||
* Simple detection of charset parameter in content-type | ||
*/ | ||
var charsetRegExp = /;\s*charset\s*=/; | ||
/** | ||
* pause is broken in node < 0.10 | ||
*/ | ||
exports.brokenPause = parseInt(nodeVersion[0], 10) === 0 | ||
@@ -428,2 +435,24 @@ && parseInt(nodeVersion[1], 10) < 10; | ||
/** | ||
* Set the charset in a given Content-Type string if none exists. | ||
* | ||
* @param {String} type | ||
* @param {String} charset | ||
* @return {String} | ||
* @api private | ||
*/ | ||
exports.setCharset = function(type, charset){ | ||
if (!type || !charset) return type; | ||
var exists = charsetRegExp.test(type); | ||
// keep existing charset | ||
if (exists) { | ||
return type; | ||
} | ||
return type + '; charset=' + charset; | ||
}; | ||
function noop() {} |
{ | ||
"name": "connect", | ||
"description": "High performance middleware framework", | ||
"version": "2.17.0", | ||
"version": "2.17.1", | ||
"author": "TJ Holowaychuk <tj@vision-media.ca> (http://tjholowaychuk.com)", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
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
153832
2523