Skip to content

Commit e2d221e

Browse files
authored
Merge pull request #1 from synchrone/fix-deep-multipart-html-preview
Fix mailhog#54
2 parents 0d4125f + 6d68d1e commit e2d221e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

assets/js/controllers.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -473,14 +473,15 @@ mailhogApp.controller('MailCtrl', function ($scope, $http, $sce, $timeout) {
473473
for(var p in part.MIME.Parts) {
474474
if("Content-Type" in part.MIME.Parts[p].Headers) {
475475
if(part.MIME.Parts[p].Headers["Content-Type"].length > 0) {
476-
if(part.MIME.Parts[p].Headers["Content-Type"][0].match(mime + ";?.*")) {
477-
return part.MIME.Parts[p];
478-
} else if (part.MIME.Parts[p].Headers["Content-Type"][0].match(/multipart\/.*/)) {
476+
if (part.MIME.Parts[p].Headers["Content-Type"][0].match(/multipart\/.*/)) {
479477
var f = $scope.findMatchingMIME(part.MIME.Parts[p], mime);
480478
if(f != null) {
481479
return f;
482480
}
483481
}
482+
if(part.MIME.Parts[p].Headers["Content-Type"][0].match(mime + ";?.*")) {
483+
return part.MIME.Parts[p];
484+
}
484485
}
485486
}
486487
}

0 commit comments

Comments
 (0)