wai-middleware-content-type

Route middlewares based on the incoming Accept HTTP header,
and other hints like the file extension (foo.txt) of the route
requested.

Usage

This package provides many combinators for turning various data
types into the response you’d expect. For instance,
blaze-html gives
us strictlyHtml data, right? We can be sure to only respond
with Html-compatible requests with our toolset: