Skip to content

Commit

Permalink
Treat videos like images
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Feb 17, 2017
1 parent 4723176 commit 6524db0
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions lib/node/index.js
Expand Up @@ -834,7 +834,7 @@ Request.prototype._end = function() {
var form = new formidable.IncomingForm();
parser = form.parse.bind(form);
buffer = true;
} else if (isImage(mime)) {
} else if (isImageOrVideo(mime)) {
parser = exports.parse.image;
buffer = true; // For backwards-compatibility buffering default is ad-hoc MIME-dependent
} else if (exports.parse[mime]) {
Expand Down Expand Up @@ -1020,19 +1020,10 @@ function isText(mime) {
|| 'x-www-form-urlencoded' == subtype;
}

/**
* Check if `mime` is image
*
* @param {String} mime
* @return {Boolean}
* @api public
*/

function isImage(mime) {
var parts = mime.split('/');
var type = parts[0];
function isImageOrVideo(mime) {
var type = mime.split('/')[0];

return 'image' == type;
return 'image' == type || 'video' == type;
}

/**
Expand Down

0 comments on commit 6524db0

Please sign in to comment.