Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

messy

Package Overview
Dependencies
Maintainers
3
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

messy - npm Package Compare versions

Comparing version 6.6.2 to 6.7.0

8

lib/decodeChunkedTransferEncoding.js

@@ -25,2 +25,6 @@ module.exports = function decodeTransferEncodingChunked(body) {

index += nextChunkLength;
// We do a best effort and exit if we've reached the end of some partial body
if (index === body.length) {
return Buffer.concat(chunks);
}
if (index + 2 >= body.length || body[index] !== 0xd || body[index + 1] !== 0xa) {

@@ -54,2 +58,6 @@ throw new Error('decodeTransferEncodingChunked: Parse error, expecting \\r\\n after chunk');

index += nextChunkLength;
// We do a best effort and exit if we've reached the end of some partial body
if (index === body.length) {
return chunks.join('');
}
if (index + 2 >= body.length || body[index] !== '\r' || body[index + 1] !== '\n') {

@@ -56,0 +64,0 @@ throw new Error('decodeTransferEncodingChunked: Parse error, expecting \\r\\n after chunk');

2

package.json
{
"name": "messy",
"version": "6.6.2",
"version": "6.7.0",
"description": "Object model for HTTP and RFC822 messages",

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

@@ -453,2 +453,33 @@ /*global describe, it*/

it('should decode Transfer-Encoding:chunked when a partial body is provided as a string', function () {
expect(new Message(
'Content-Type: text/plain; charset=UTF-8\r\n' +
'Transfer-Encoding: chunked\r\n' +
'\r\n' +
'4\r\n' +
'Wiki\r\n' +
'5\r\n' +
'pedia\r\n' +
'e\r\n' +
' in\r\n\r\nchunks.'
).unchunkedBody, 'to equal', 'Wikipedia in\r\n\r\nchunks.');
});
it('should decode Transfer-Encoding:chunked when a partial body is provided as a Buffer', function () {
expect(new Message(
new Buffer(
'Content-Type: text/plain; charset=UTF-8\r\n' +
'Transfer-Encoding: chunked\r\n' +
'\r\n' +
'4\r\n' +
'Wiki\r\n' +
'5\r\n' +
'pedia\r\n' +
'e\r\n' +
' in\r\n\r\nchunks.',
'utf-8'
)
).unchunkedBody, 'to equal', new Buffer('Wikipedia in\r\n\r\nchunks.', 'utf-8'));
});
describe('when accessed as a setter', function () {

@@ -455,0 +486,0 @@ it('should update rawBody and body', function () {

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