Socket
Socket
Sign inDemoInstall

http-parser-js

Package Overview
Dependencies
Maintainers
2
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-parser-js - npm Package Compare versions

Comparing version 0.4.8 to 0.4.9

16

http-parser.js

@@ -282,2 +282,3 @@ /*jshint node:true */

var hasContentLength = false;
var currentContentLengthValue;
for (var i = 0; i < headers.length; i += 2) {

@@ -289,7 +290,16 @@ switch (headers[i].toLowerCase()) {

case 'content-length':
currentContentLengthValue = +headers[i + 1];
if (hasContentLength) {
throw parseErrorCode('HPE_UNEXPECTED_CONTENT_LENGTH');
// Fix duplicate Content-Length header with same values.
// Throw error only if values are different.
// Known issues:
// https://github.com/request/request/issues/2091#issuecomment-328715113
// https://github.com/nodejs/node/issues/6517#issuecomment-216263771
if (currentContentLengthValue !== this.body_bytes) {
throw parseErrorCode('HPE_UNEXPECTED_CONTENT_LENGTH');
}
} else {
hasContentLength = true;
this.body_bytes = currentContentLengthValue;
}
hasContentLength = true;
this.body_bytes = +headers[i + 1];
break;

@@ -296,0 +306,0 @@ case 'connection':

2

package.json
{
"name": "http-parser-js",
"version": "0.4.8",
"version": "0.4.9",
"description": "A pure JS HTTP parser for node.",

@@ -5,0 +5,0 @@ "main": "http-parser.js",

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