From eac6fe7c939ebfbd5452edf2c4f70a19f372f133 Mon Sep 17 00:00:00 2001 From: Pyfisch Date: Mon, 29 Dec 2014 21:03:24 +0100 Subject: [PATCH] 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. --- src/header/common/util.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/header/common/util.rs b/src/header/common/util.rs index 0d272463..5b1889eb 100644 --- a/src/header/common/util.rs +++ b/src/header/common/util.rs @@ -31,7 +31,8 @@ pub fn from_one_comma_delimited(raw: &[u8]) -> Option> { match from_utf8(raw) { Ok(s) => { Some(s.as_slice() - .split([',', ' '].as_slice()) + .split(',') + .map(|x| x.trim()) .filter_map(FromStr::from_str) .collect()) }