busboy
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -40,8 +40,11 @@ // TODO: | ||
var nfiles = 0, nfields = 0, nparts = 0; | ||
var nfiles = 0, nfields = 0, nparts = 0, self = this; | ||
this._finished = false; | ||
this._boy = boy; | ||
this.parser = new Dicer({ boundary: boundary }); | ||
this.parser.on('part', function onPart(part) { | ||
this.parser.on('part', function(part) { | ||
if (++nparts > partsLimit) { | ||
this.parser.removeListener(onPart); | ||
this.parser.removeAllListeners('part'); | ||
return; | ||
@@ -62,11 +65,11 @@ } | ||
} | ||
if (charset === 'us-ascii') | ||
charset = 'ascii'; | ||
else if (charset === 'utf-8') | ||
charset = 'utf8'; | ||
else if (charset === 'utf-16le') | ||
charset = 'ucs2'; | ||
} | ||
if (charset === undefined) | ||
charset = 'ISO-8859-1'; | ||
else if (charset === 'us-ascii') | ||
charset = 'ascii'; | ||
else if (charset === 'utf-8') | ||
charset = 'utf8'; | ||
else if (charset === 'utf-16le') | ||
charset = 'ucs2'; | ||
@@ -105,3 +108,3 @@ if (header['content-disposition']) { | ||
file.emit('limit'); | ||
part.removeListener(onData); | ||
part.removeAllListeners('data'); | ||
} else | ||
@@ -126,3 +129,3 @@ file.emit('data', data); | ||
truncated = true; | ||
part.removeListener(onData); | ||
part.removeAllListeners('data'); | ||
} else | ||
@@ -142,2 +145,3 @@ buffer += data.toString('binary'); | ||
this.parser.once('end', function() { | ||
self._finished = true; | ||
boy.emit('end'); | ||
@@ -153,2 +157,6 @@ }); | ||
this.parser.reset(); | ||
if (!this._finished) { | ||
this._finished = true; | ||
this._boy.emit('end'); | ||
} | ||
}; | ||
@@ -155,0 +163,0 @@ |
@@ -28,3 +28,6 @@ var iconv = require('iconv-lite'); | ||
} | ||
if (charset === 'us-ascii') | ||
if (charset === undefined) | ||
charset = 'ISO-8859-1'; | ||
else if (charset === 'us-ascii') | ||
charset = 'ascii'; | ||
@@ -35,4 +38,2 @@ else if (charset === 'utf-8') | ||
charset = 'ucs2'; | ||
else if (charset === undefined) | ||
charset = 'ISO-8859-1'; | ||
@@ -39,0 +40,0 @@ this.decoder = new Decoder(); |
{ "name": "busboy", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"author": "Brian White <mscdex@mscdex.net>", | ||
@@ -7,3 +7,3 @@ "description": "A node.js module for parsing incoming HTML form data", | ||
"dependencies": { | ||
"dicer": "*", | ||
"dicer": "0.1.2", | ||
"readable-stream": "*", | ||
@@ -10,0 +10,0 @@ "iconv-lite": "0.2.10" |
Floating dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
30976
734
1
+ Addeddicer@0.1.2(transitive)
+ Addedstreamsearch@0.1.2(transitive)
- Removeddicer@0.3.1(transitive)
- Removedstreamsearch@1.1.0(transitive)
Updateddicer@0.1.2