Socket
Socket
Sign inDemoInstall

connect

Package Overview
Dependencies
Maintainers
4
Versions
234
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

connect - npm Package Compare versions

Comparing version 2.17.0 to 2.17.1

5

History.md

@@ -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 @@ ===================

2

lib/patch.js

@@ -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": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc