senchalabs/connect — pull request #826 by DominiqueLeroux (2013-06-19 18:28:43+00:00)
Title: Flexible json content type

JSON body parser now has:

. MIME type matching through a regular expression rather than using a string comparison with 'application/json'.
. A default MIME type regular expression that performs a case-insensitive match on MIME types.
. A default MIME type regular expression that also matches suffixes, as in 'application/vnd.acme.data.com+json'.
. A way to access the JSON body parser's default regular expression through connect.json.defaultMimeRegExp.
. A way to override the default regular expression through the options.mimeRegExp.

This is to support MIME types that have suffixes as described here:

http://trac.tools.ietf.org/html/draft-ietf-appsawg-media-type-suffix-regs-02#section-3.1

Tests were added to validate all the above claims.