Skip to content
Browse files

close stream after write is complete

  • Loading branch information...
1 parent c817b86 commit 2dd6a7d368d7ded4be8e065adef3d06fe209fa03 @omphalos committed Sep 23, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 crud-file-server.js
View
2 crud-file-server.js
@@ -175,7 +175,7 @@ exports.handleRequest = function(vpath, path, req, res, readOnly, logHeadRequest
var stream = fs.createWriteStream(relativePath);
stream.ok = true;
req.pipe(stream); // TODO: limit data length
- req.on('end', function() {
+ stream.on('close', function() {
if(stream.ok) {
res.end();
}

0 comments on commit 2dd6a7d

Please sign in to comment.
Something went wrong with that request. Please try again.