apiaryio/apiblueprintorg — pull request #13 by honzajavorek (2014-07-16 18:43:09+00:00)
Title: Charset handling

https://trello.com/c/NTKofski/1744-api-blueprint-api-charset-behavior

Implements charset handling discussed here: https://github.com/apiaryio/apiblueprintorg/pull/7#issuecomment-49074506

BEWARE: This branch is builds upon code in https://github.com/apiaryio/apiblueprintorg/pull/12, so until that one is merged, this shouldn't be considered for review or merge.

Implementation:

- all responses are in utf-8
- `/composer` responds with `text/vnd.apiblueprint+markdown; charset=utf-8` - includes charset, because it's `text/...`
- other stuff is served without charset in `Content-Type`, because it's redundant and it could confuse people or encourage them to try different charsets
- payload is accepted only as utf-8 - if any mention about charset is missing, utf-8 is assumed; if content type of incoming data has charset parameter, it has to be utf-8, otherwise the request is rejected
- if client sends `Accept-Encoding` and its content doesn't expect the response to be in utf-8, request is also rejected