diff --git a/src/header/common/referrer_policy.rs b/src/header/common/referrer_policy.rs index 154ba90c79..a91946f2cd 100644 --- a/src/header/common/referrer_policy.rs +++ b/src/header/common/referrer_policy.rs @@ -54,8 +54,9 @@ impl Header for ReferrerPolicy { fn parse_header(raw: &Raw) -> ::Result { use self::ReferrerPolicy::*; - parsing::from_one_raw_str(raw).and_then(|s: String| { - let slice = &s.to_ascii_lowercase()[..]; + parsing::from_comma_delimited(raw).and_then(|v: Vec| { + let last = v.iter().last().unwrap(); + let slice = &last.to_ascii_lowercase()[..]; // See https://www.w3.org/TR/referrer-policy/#determine-policy-for-token match slice { "no-referrer" | "never" => Ok(NoReferrer),