twilio/flask-restful — pull request #98 by bbenne10 (2013-06-17 19:39:40+00:00)
Title: Allow developers to specify content-type

Currently, Flask-restful will ALWAYS override the response's content-type, irregardless of whether it was explicitly set by the developer. This pull request is a small change that will use the most recently added declaration in the case that the developer has added a content-type.

What I'm doing now is to exploit the fact that `MultiDicts` are key to list mappings under the covers (and thus ordered). We just pull the most recently added value and use it if the list is longer than one element.

This solution isn't perfect, but I don't see a better one seeing as Flask explicitly adds `text/html;encoding=utf-8` to it's response objects.

Criticism welcomed. I'll be happy to fix any shortcomings. Just let me know.