Skip to content

Commit

Permalink
Fix min file size not considered
Browse files Browse the repository at this point in the history
  • Loading branch information
slgobinath committed Mar 23, 2018
1 parent 65b28bd commit 4103443
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions extension/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ function setDownloadHooks() {
disposition = details.responseHeaders[i].value;
if (disposition.lastIndexOf('filename') != -1) {
var found = disposition.match(/filename[^;=\n]*\*=UTF-8''((['"]).*?\2|[^;\n]*)/);
if(found) {
if (found) {
message.FileName = decodeURI(found[1]);
} else {
message.FileName = disposition.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/)[1];
Expand Down Expand Up @@ -733,16 +733,16 @@ function isWhiteListedContent(contentType) {
whiteListed = false;
// Test the content type
if (contentType) {
if (/\b(?:application\/|video\/|audio\/)\b/.test(contentType)) {
whiteListed = true;
} else {
for (var keyword of mimeToInterrupt) {
if (contentType.includes(keyword)) {
whiteListed = true;
break;
}
// if (/\b(?:application\/|video\/|audio\/)\b/.test(contentType)) {
// whiteListed = true;
// } else {
for (var keyword of mimeToInterrupt) {
if (contentType.includes(keyword)) {
whiteListed = true;
break;
}
}
// }
}
return whiteListed;
}
Expand Down

0 comments on commit 4103443

Please sign in to comment.