Skip to content

Commit

Permalink
don't crash when firefox tries to send a directory
Browse files Browse the repository at this point in the history
  • Loading branch information
mnutt committed Nov 9, 2015
1 parent a3a27dc commit ee166d1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ exports.upload = function(root) {
var form = new multiparty.Form();

form.parse(req, function(err, fields, files) {
if(err || !files) {
res.writeHead(500, {});
res.end("Missing file to upload");
return;
}

files = files.file;

// Files and fields are separated for some reason; zip them together
Expand Down

0 comments on commit ee166d1

Please sign in to comment.