make_url: Drop whitespace within data: URLs

This commit is contained in:
Keegan McAllister 2013-10-09 20:35:55 -07:00
parent 3824a01dc5
commit 2aa05e8d23

View file

@ -62,6 +62,12 @@ pub fn make_url(str_url: ~str, current_url: Option<Url>) -> Url {
_ => str_url
}
},
~"data" => {
// Drop whitespace within data: URLs, e.g. newlines within a base64
// src="..." block. Whitespace intended as content should be
// %-encoded or base64'd.
str_url.iter().filter(|&c| !c.is_whitespace()).collect()
},
_ => str_url
}
}