fix(headers): Do not parse empty values in list headers.
In empty list header values ``, or list header values with empty items `foo, , bar`, the empty value is parsed, if the parser does not reject empty values an item is added to the resulting header. There can't be empty values. Added a test for it in AcceptEncoding.
This commit is contained in:
@@ -20,7 +20,7 @@ header! {
|
||||
test_accept_encoding {
|
||||
// From the RFC
|
||||
test_header!(test1, vec![b"compress, gzip"]);
|
||||
test_header!(test2, vec![b""]);
|
||||
test_header!(test2, vec![b""], Some(AcceptEncoding(vec![])));
|
||||
test_header!(test3, vec![b"*"]);
|
||||
// Note: Removed quality 1 from gzip
|
||||
test_header!(test4, vec![b"compress;q=0.5, gzip"]);
|
||||
|
||||
Reference in New Issue
Block a user