mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Don’t drop whitespace in data: URLs. FromBase64 already skips newlines.
This commit is contained in:
parent
6848e78bb3
commit
2fea2cd911
1 changed files with 1 additions and 11 deletions
|
@ -40,17 +40,7 @@ pub fn try_parse_url(str_url: &str, base_url: Option<Url>) -> Result<Url, &'stat
|
||||||
return Err(err)
|
return Err(err)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Ok(url) => {
|
Ok(url) => return Ok(url)
|
||||||
match (url.scheme.as_slice(), url.scheme_data.clone()) {
|
|
||||||
("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.as_slice().chars().filter(|&c| !c.is_whitespace()).collect()
|
|
||||||
},
|
|
||||||
_ => return Ok(url)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
parser.parse(str_url.as_slice())
|
parser.parse(str_url.as_slice())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue