fuel/core — pull request #761 by whitman (2012-01-04 13:27:43+00:00)
Title: Detect rest accept format by quality

The current checking of HTTP_ACCEPT only looks to see if a format is in the header but doesn't do anything with the quality scoring. This makes the search dependent on the order that the formats are defined in `$this->_supported_formats`

This patch will take an Accept header such as:

Accept: application/json,application/xml,text/html;q=0.9;text/plain;q=0.8;*/*;q=0.5

and assign scores to each format:

- application/json: 1
- application/xml: 1
- text/html: 0.9
- text/plain: 0.8
- */*: 0.5

The highest scoring format that is supported will be returned. If multiple supported formats share the same score then the first one is chosen. Order of same value formats in the Accept header is kept.

Thoughts/comments/merge?