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

raw-body

Package Overview
Dependencies
Maintainers
2
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

raw-body - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

5

HISTORY.md

@@ -0,1 +1,6 @@

1.2.2 / 2014-06-19
==================
* Send invalid encoding error to callback
1.2.1 / 2014-06-15

@@ -2,0 +7,0 @@ ==================

15

index.js

@@ -74,3 +74,16 @@ var bytes = require('bytes')

var received = 0
var decoder = getDecoder(encoding)
var decoder
try {
decoder = getDecoder(encoding)
} catch (err) {
if (typeof stream.pause === 'function')
stream.pause()
process.nextTick(function () {
done(err)
})
return defer
}
var buffer = decoder

@@ -77,0 +90,0 @@ ? ''

2

package.json
{
"name": "raw-body",
"description": "Get and validate the raw body of a readable stream.",
"version": "1.2.1",
"version": "1.2.2",
"author": "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)",

@@ -6,0 +6,0 @@ "contributors": [

@@ -70,4 +70,5 @@ # raw-body

- `received` - the received bytes
- `encoding` - the invalid encoding
- `status` and `statusCode` - the corresponding status code for the error
- `type` - either `entity.too.large`, `request.size.invalid`, or `stream.encoding.set`
- `type` - either `entity.too.large`, `request.size.invalid`, `stream.encoding.set`, or `encoding.unsupported`

@@ -74,0 +75,0 @@ - `res` - the result, either as a `String` if an encoding was set or a `Buffer` otherwise.

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