Fixes from_one_comma_delimited, no more split at space
Before from_one_comma_delimited split at ",", and " " this made it unusable for the Accept-* headers since their fields may contain whitespace.
This commit is contained in:
@@ -31,7 +31,8 @@ pub fn from_one_comma_delimited<T: FromStr>(raw: &[u8]) -> Option<Vec<T>> {
|
|||||||
match from_utf8(raw) {
|
match from_utf8(raw) {
|
||||||
Ok(s) => {
|
Ok(s) => {
|
||||||
Some(s.as_slice()
|
Some(s.as_slice()
|
||||||
.split([',', ' '].as_slice())
|
.split(',')
|
||||||
|
.map(|x| x.trim())
|
||||||
.filter_map(FromStr::from_str)
|
.filter_map(FromStr::from_str)
|
||||||
.collect())
|
.collect())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user