rack/rack — pull request #677 by bestie (2014-04-19 11:16:57+00:00)
Title: ShowException serves HTML only when accepted

Rather than be concerned with whether a request is an asynchronous browser
request or not it is better to simply consider the Accept header and only serve
HTML to clients that specifically ask for it.

This way you will not find your pure JSON API application splitting out HTML
error messages to your console when using curl :)