Comparing version 21.3.0 to 21.3.1
@@ -60,2 +60,7 @@ | ||
if (negod.type === "multipart") { | ||
;(req.res || req).on("close", function() { | ||
if (req.files) for (var i = req.files.length; i--; ) { | ||
if (req.files[i].tmp) fs.unlink(req.files[i].tmp, util.nop) | ||
} | ||
}) | ||
stream = stream | ||
@@ -89,7 +94,2 @@ .pipe(multipart(negod.boundary, reqOpts || {}, req)) | ||
next = null | ||
if (req.files) req.res.on("finish", function() { | ||
for (var i = req.files.length; i--; ) { | ||
if (req.files[i].tmp) fs.unlink(req.files[i].tmp, util.nop) | ||
} | ||
}) | ||
} | ||
@@ -162,3 +162,3 @@ } | ||
bufsBytes = bufs.length = 0 | ||
} else if (cut > 0 || pos < len - 1) { | ||
} else if (cut > 0) { | ||
buf = buf.slice(cut, pos - needle.length + 1) | ||
@@ -168,3 +168,3 @@ } | ||
if (negod) { | ||
if (remainingFields-- < 1) return writable.destroy({ code: 413, message: "maxFields exceeded"}) | ||
if (remainingFields-- < 1) return cb({ code: 413, message: "maxFields exceeded"}) | ||
if (negod.preamble) { | ||
@@ -188,3 +188,3 @@ req.emit("preamble", req.preamble = buf.toString("utf8", 2)) | ||
if (negod.filename) { | ||
if (remainingFiles-- < 1) return writable.destroy({ code: 413, message: "maxFiles exceeded"}) | ||
if (remainingFiles-- < 1) return cb({ code: 413, message: "maxFiles exceeded"}) | ||
if (!req.files) req.files = [] | ||
@@ -215,11 +215,12 @@ req.files.push(negod) | ||
if (fileStream) { | ||
for (; bufs.length > 1 && bufsBytes - bufs[bufs.length - 1].length > needle.length; ) { | ||
if (!fileStream.write(bufs.pop())) { | ||
return fileStream.once("drain", cb) | ||
} | ||
writeChunk() | ||
function writeChunk() { | ||
if (fileStream && bufs[1] && bufsBytes - bufs[0].length > needle.length) { | ||
bufsBytes -= bufs[0].length | ||
fileStream.write(bufs.shift(), writeChunk) | ||
} else { | ||
process.nextTick(cb) | ||
} | ||
} | ||
cb() | ||
} | ||
@@ -226,0 +227,0 @@ } |
{ | ||
"name": "litejs", | ||
"version": "21.3.0", | ||
"version": "21.3.1", | ||
"description": "Full-stack web framework in a tiny package", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
2332
71694