diff --git a/lib/contentTypeParser.js b/lib/contentTypeParser.js index b32cc09880..d4eb906b48 100644 --- a/lib/contentTypeParser.js +++ b/lib/contentTypeParser.js @@ -70,6 +70,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) @@ -389,7 +390,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 {