Skip to content

Instantly share code, notes, and snippets.

@dshafik
Created February 22, 2012 02:56
Show Gist options
  • Save dshafik/1880946 to your computer and use it in GitHub Desktop.
Save dshafik/1880946 to your computer and use it in GitHub Desktop.
The media type quality factor associated with a given type is determined by finding the media range with the highest precedence which matches that type. For example,
Accept: text/*;q=0.3, text/html;q=0.7, text/html;level=1,
text/html;level=2;q=0.4, */*;q=0.5
would cause the following values to be associated:
text/html;level=1 = 1
text/html = 0.7
text/plain = 0.3
image/jpeg = 0.5
text/html;level=2 = 0.4
text/html;level=3 = 0.7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment