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

ee-formdata-reader

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ee-formdata-reader - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

25

lib/FormdataReader.js

@@ -63,16 +63,15 @@

// select the correct decoder
switch( this.request.getHeader( "content-type" ) ){
case "multipart/form-data":
this.decoder = new MimeDecoder();
this.decoder.on( "data", this.handleMimePart.bind( this ) );
this.isMultipart = true;
break;
case "application/x-www-form-urlencoded":
this.decoder = new StreamURLDecoder();
this.decoder.on( "data", this.handleFormData.bind( this ) );
break;
default:
throw new Error( "unknown formdata encoding!" ).setName( "InvalidEncodingException" );
// select the correct MimeDecoder
if ( this.request.getHeader( "content-type" ) === "application/x-www-form-urlencoded" ){
this.decoder = new StreamURLDecoder();
this.decoder.on( "data", this.handleFormData.bind( this ) );
}
else {
this.decoder = new MimeDecoder();
this.decoder.on( "data", this.handleMimePart.bind( this ) );
this.isMultipart = true;
// need to set a fake header for the parser
this.handleData( new Buffer( "Content-Type: " + this.request.getHeader( "content-type" ) + "\n\n\n" ) );
}

@@ -79,0 +78,0 @@ // handle decoder end

{
"name" : "ee-formdata-reader"
, "description" : "reads formdata from a request"
, "version" : "0.1.1"
, "version" : "0.1.2"
, "homepage" : "https://github.com/eventEmitter/ee-formdata-reader"

@@ -6,0 +6,0 @@ , "author" : "Michael van der Weg <michael@eventemitter.com> (http://eventemitter.com/)"

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