Correct detection of application/json content type

* Adds utility method for matching content type headers