multiparty
Advanced tools
Comparing version 3.2.3 to 3.2.4
@@ -0,1 +1,10 @@ | ||
### 3.2.4 | ||
* Keep part.byteCount undefined in chunked encoding (thanks [dougwilson]) | ||
* Fix temp files not always cleaned up (thanks [dougwilson]) | ||
### 3.2.3 | ||
* improve parsing boundary attribute from Content-Type (thanks [dougwilson]) | ||
### 3.2.2 | ||
@@ -2,0 +11,0 @@ |
17
index.js
@@ -198,3 +198,3 @@ exports.Form = Form; | ||
case START_BOUNDARY: | ||
if (index === boundaryLength - 2 && c == HYPHEN) { | ||
if (index === boundaryLength - 2 && c === HYPHEN) { | ||
index = 1; | ||
@@ -470,6 +470,6 @@ state = CLOSE_BOUNDARY; | ||
var partContentLength = self.destStream.headers['content-length']; | ||
self.destStream.byteCount = partContentLength ? | ||
parseInt(partContentLength, 10) : | ||
(self.bytesExpected - self.destStream.byteOffset - | ||
self.boundary.length - LAST_BOUNDARY_SUFFIX_LEN); | ||
self.destStream.byteCount = partContentLength ? parseInt(partContentLength, 10) : | ||
self.bytesExpected ? (self.bytesExpected - self.destStream.byteOffset - | ||
self.boundary.length - LAST_BOUNDARY_SUFFIX_LEN) : | ||
undefined; | ||
@@ -522,13 +522,13 @@ self.emit('part', self.destStream); | ||
if (!file.ws) return; | ||
file.ws.destroy(); | ||
file.ws.removeAllListeners('close'); | ||
if (typeof file.ws.fd !== 'number') return; | ||
file.ws.on('close', function() { | ||
fs.unlink(file.path, function(err) { | ||
if (!self.error) self.handleError(err); | ||
if (err && !self.error) self.handleError(err); | ||
}); | ||
}); | ||
file.ws.destroy(); | ||
} | ||
function handleFile(self, fileStream) { | ||
if (self.error) return; | ||
beginFlush(self); | ||
@@ -566,2 +566,3 @@ var file = { | ||
fileStream.unpipe(counter); | ||
fileStream.unpipe(file.ws); | ||
self.handleError(new Error("maxFilesSize " + self.maxFilesSize + " exceeded")); | ||
@@ -568,0 +569,0 @@ } |
{ | ||
"name": "multiparty", | ||
"version": "3.2.3", | ||
"version": "3.2.4", | ||
"description": "multipart/form-data parser which supports streaming", | ||
@@ -5,0 +5,0 @@ "repository": { |
37516
591