mirror of
https://github.com/valitydev/salt.git
synced 2024-11-06 16:45:27 +00:00
5e9c3c7d96
It currently supports 'simple' values like application/json, but Accept header could also include more than one value with parameters See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1. For example: ```application/json, text/javascript, */*; q=0.01``` This PR add support for multiple media_range in Accept header, support parsing of parameter (like q=0.01) but discard them and finally iterate on media_range and take the first compatible. A more complete implementation may fully supports the RFC and support q parameter and specific order of priority to find the most compatible Content-Type but I don't think it's worth the pain. If we want a better implementation, werkzeug has actually an implementation http://werkzeug.pocoo.org/docs/0.10/datastructures/#werkzeug.datastructures.Accept.best_match. |
||
---|---|---|
.. | ||
rest_cherrypy | ||
rest_tornado | ||
__init__.py |