From e27e98702ec803ba2f12f6196fdadb8cb20ecf93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 28 Apr 2016 10:17:47 +0300 Subject: Add test case for negative q value --- testdata.json | 1 + 1 file changed, 1 insertion(+) (limited to 'testdata.json') diff --git a/testdata.json b/testdata.json index 409ab72..d5f079a 100644 --- a/testdata.json +++ b/testdata.json @@ -4,6 +4,7 @@ ["application/xml", ["application", "xml", {"q": "1"}]], ["application/xml;q=",["application", "xml", {"q": "1"}]], ["application/xml ;q=",["application", "xml", {"q": "1"}]], + ["application/xml ;q=-1",["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"}]], ["application/xml ; q=0",["application", "xml", {"q": "0"}]], -- cgit v1.2.1 From 7d3bf001d284ffbd9d555ce213241040c291f79b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 28 Apr 2016 10:41:02 +0300 Subject: Handle non-numeric q value gracefully --- testdata.json | 1 + 1 file changed, 1 insertion(+) (limited to 'testdata.json') diff --git a/testdata.json b/testdata.json index d5f079a..ab7693c 100644 --- a/testdata.json +++ b/testdata.json @@ -8,6 +8,7 @@ ["application/xml ; q=1;b=other",["application", "xml", {"q": "1", "b":"other"}]], ["application/xml ; q=2;b=other",["application", "xml", {"q": "1", "b":"other"}]], ["application/xml ; q=0",["application", "xml", {"q": "0"}]], + ["application/xml ; q=foo", ["application", "xml", {"q": "1"}]], [" *; q=.2",["*", "*", {"q": ".2"}]] ], -- cgit v1.2.1 From 64a64e32ab8c14e91a6a196cf0a2dd7637d4f3a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 28 Apr 2016 10:47:19 +0300 Subject: Handle q parameter name case insensitively https://tools.ietf.org/html/rfc7231#section-5.3.1 --- testdata.json | 1 + 1 file changed, 1 insertion(+) (limited to 'testdata.json') diff --git a/testdata.json b/testdata.json index ab7693c..4f0a648 100644 --- a/testdata.json +++ b/testdata.json @@ -9,6 +9,7 @@ ["application/xml ; q=2;b=other",["application", "xml", {"q": "1", "b":"other"}]], ["application/xml ; q=0",["application", "xml", {"q": "0"}]], ["application/xml ; q=foo", ["application", "xml", {"q": "1"}]], + ["application/xml ; Q=0.6", ["application", "xml", {"q": "0.6"}]], [" *; q=.2",["*", "*", {"q": ".2"}]] ], -- cgit v1.2.1