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

rfc2231

Package Overview
Dependencies
Maintainers
1
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.1.1 to 1.2.0

12

lib/rfc2231.js

@@ -111,2 +111,10 @@ /*global unescape*/

function quoteParameterIfNecessary(value) {
if (/[()<>@,;:\\"\/[\]?=]/.test(value)) {
return '"' + value.replace(/[\\"]/g, '\\$&') + '"';
} else {
return value;
}
}
rfc2231.encodeAndFoldParameters = function (decodedParameters, maxFragmentLength, forceUtf8) {

@@ -150,3 +158,3 @@ var encodedParameters = {};

}
encodedParameters[parameterName + '*' + fragmentNum + (isEncoded ? '*' : '')] = isEncoded ? fragment : '"' + fragment.replace(/[\\"]/g, '\\$&') + '"';
encodedParameters[parameterName + '*' + fragmentNum + (isEncoded ? '*' : '')] = quoteParameterIfNecessary(fragment);

@@ -157,3 +165,3 @@ pos += fragment.length;

} else {
encodedParameters[parameterName + (isEncoded ? '*' : '')] = isEncoded ? value : '"' + value.replace(/[\\"]/g, '\\$&') + '"';
encodedParameters[parameterName + (isEncoded ? '*' : '')] = quoteParameterIfNecessary(value);
}

@@ -160,0 +168,0 @@ });

2

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

@@ -5,0 +5,0 @@ "main": "lib/rfc2231.js",

@@ -20,2 +20,6 @@ /*global describe, it*/

it('should only quote parameter values that contain tspecials (rfc2045)', function () {
expect({bar: 'baz', foo: '>', quotes: '""'}, 'to encode to', {bar: 'baz', foo: '">"', quotes: '"\\"\\""'});
});
it('Single-line us-ascii (from RFC2231)', function () {

@@ -95,3 +99,3 @@ expect({

}, 'to encode back and forth to', {
foo: '"aa"'
foo: 'aa'
});

@@ -104,4 +108,4 @@ });

}, 'to encode back and forth to', {
'foo*0': '"012345678901234567890123456789012345678901234567890123456789"',
'foo*1': '"0123456789"'
'foo*0': '012345678901234567890123456789012345678901234567890123456789',
'foo*1': '0123456789'
});

@@ -108,0 +112,0 @@ });

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