diff --git a/lib/contentTypeParser.js b/lib/contentTypeParser.js index dc8f4de389..eb321e06f4 100644 --- a/lib/contentTypeParser.js +++ b/lib/contentTypeParser.js @@ -72,6 +72,7 @@ ContentTypeParser.prototype.add = function (contentType, opts, parserFn) { if (contentTypeIsString) { this.parserList.unshift(new ParserListItem(contentType)) } else { + contentType.isEssence = contentType.source.indexOf(';') === -1 this.parserRegExpList.unshift(contentType) } this.customParsers.set(contentType.toString(), parser) @@ -396,7 +397,7 @@ function compareContentType (contentType, parserListItem) { } function compareRegExpContentType (contentType, essenceMIMEType, regexp) { - if (regexp.source.indexOf(';') === -1) { + if (regexp.isEssence) { // we do essence check return regexp.test(essenceMIMEType) } else {