summaryrefslogtreecommitdiff
path: root/testdata.json
blob: aea0c55bb2e598046c50c2f7d8d658c5b6759181 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
"parse_media_range": [
		     ["application/xml;q=1", ["application", "xml", {"q": "1"}]],
		     ["application/xml", ["application", "xml", {"q": "1"}]],
		     ["application/xml;q=",["application", "xml", {"q": "1"}]],
		     ["application/xml ;q=",["application", "xml", {"q": "1"}]],
		     ["application/xml ; q=1;b=other",["application", "xml", {"q": "1", "b":"other"}]],
		     ["application/xml ; q=2;b=other",["application", "xml", {"q": "1", "b":"other"}]],
		     [" *; q=.2",["*", "*", {"q": ".2"}]]
],

"quality": [
            [["text/html;level=1", "text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5"], 1],
            [["text/html", "text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5"], 0.7],
            [["text/plain", "text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5"], 0.3],
            [["image/jpeg", "text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5"], 0.5],
            [["text/html;level=2", "text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5"], 0.4],
            [["text/html;level=3", "text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5"], 0.7]
],

"best_match": [
	      [[["application/xbel+xml", "application/xml"], "application/xbel+xml"], "application/xbel+xml", "direct match"],
	      [[["application/xbel+xml", "application/xml"], "application/xbel+xml; q=1"], "application/xbel+xml", "direct match with a q parameter"],
	      [[["application/xbel+xml", "application/xml"], "application/xml; q=1"], "application/xml", "direct match of our second choice with a q parameter"],
	      [[["application/xbel+xml", "application/xml"], "application/*; q=1"], "application/xml", "match using a subtype wildcard"],
	      [[["application/xbel+xml", "application/xml"], "*/*", "application/xml"], "application/xml", "match using a type wildcard"],
	      [[["application/xbel+xml", "text/xml"], "text/*;q=0.5,*/*; q=0.1"], "text/xml", "match using a type versus a lower weighted subtype"],
	      [[["application/xbel+xml", "text/xml"], "text/html,application/atom+xml; q=0.9"], "", "fail to match anything"],
	      [[["application/json", "text/html"], "application/json, text/javascript, */*"], "application/json", "common AJAX scenario"],
	      [[["application/json", "text/html"], "application/json, text/html;q=0.9"], "application/json", "verify fitness ordering"],
	      [[["image/*", "application/xml"], "image/png"], "image/*", "match using a type wildcard"],
	      [[["image/*", "application/xml"], "image/*"], "image/*", "match using a wildcard for both requested and supported"]
]
}