New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rfc2231

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rfc2231 - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

10

lib/rfc2231.js

@@ -109,5 +109,7 @@ /*global unescape*/

// We want to percent-encode all everything that'd require a fragment to be enclosed in double quotes:
var unsafeParameterValueRegExp = /[\u0000-\u001f '%\u0080-\uffff]/;
// Allowed in output: <any (US-ASCII) CHAR except SPACE, CTLs (\u0000-\u001f\u007f), "*", "'", "%", or tspecials>
var unsafeParameterValueRegExp = /[\u0000-\u001f \u007f*'%\u0080-\uffff]/;
function quoteParameterIfNecessary(value) {
// tspecials, see definition in rfc2045
if (/[()<>@,;:\\"\/[\]?=]/.test(value)) {

@@ -133,3 +135,7 @@ return '"' + value.replace(/[\\"]/g, '\\$&') + '"';

var charCode = value.charCodeAt(i);
encodedValue += '%' + (charCode < 16 ? '0' : '') + charCode.toString(16).toUpperCase();
if (unsafeParameterValueRegExp.test(value[i])) {
encodedValue += '%' + (charCode < 16 ? '0' : '') + charCode.toString(16).toUpperCase();
} else {
encodedValue += value[i];
}
}

@@ -136,0 +142,0 @@ } else {

4

package.json
{
"name": "rfc2231",
"version": "1.2.0",
"version": "1.3.0",
"description": "Encode and decode rfc2231/rfc5987",

@@ -38,3 +38,3 @@ "main": "lib/rfc2231.js",

"coveralls": "2.11.2",
"iconv": "2.1.4",
"iconv": "2.2.1",
"istanbul": "0.3.5",

@@ -41,0 +41,0 @@ "jshint": "2.5.11",

@@ -115,3 +115,3 @@ /*global describe, it*/

}, 'to encode back and forth to', {
'bar*': "iso-8859-1''%46%6F%6F%E6"
'bar*': "iso-8859-1''Foo%E6"
});

@@ -137,2 +137,10 @@ });

});
it('parameter value containing delete character', function () {
expect({
filename: 'abc\x7Fdef.jpg'
}, 'to encode to', {
'filename*': 'iso-8859-1\'\'abc%7Fdef.jpg'
});
});
});
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