mattetti/wd-sinatra — pull request #30 by kamui (2013-05-10 03:54:49+00:00)
Title: Set content type based on accept header

Related to #14 and https://github.com/mattetti/Weasel-Diesel/issues/6.

Ended up setting the format in `env["wd.format"]` to match `service.formats`. The purpose of the `SUPPORTED_MEDIA_TYPES` map is so you can define custom media types like `application/vnd.example-v1+json` and map that to `:json`. I ended up storing the selected media type as `env["wd.media_type"]` so you can access it from the service implementation.