ee-formdata-reader
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -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/)" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9332
164