Permalink
Browse files

Fix horrifically broken /file PUT

  • Loading branch information...
1 parent 2e206e8 commit cefb4d9571f22ce79b2d6dcaae8ef33cf71646ab @mamacdon committed Dec 10, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/file.js
View
@@ -193,7 +193,10 @@ module.exports = function(options) {
} else {
// write buffer into file
fs.writeFile(filepath, requestBody, function(error) {
- writeError(500, res, error);
+ if (error) {
+ writeError(500, res, error);
+ return;
+ }
writeFileMetadata(res, rest, filepath, stats, requestBodyETag.getValue() /*the new ETag*/);
});
}

0 comments on commit cefb4d9

Please sign in to comment.