mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Ignore spaces in base64 data URLs. Fix #1268.
This commit is contained in:
parent
f44f974f91
commit
82a34164a8
1 changed files with 2 additions and 0 deletions
|
@ -64,6 +64,8 @@ fn load(load_data: LoadData, start_chan: Sender<LoadResponse>) {
|
||||||
let bytes = percent_decode(parts.get(1).as_bytes());
|
let bytes = percent_decode(parts.get(1).as_bytes());
|
||||||
|
|
||||||
if is_base64 {
|
if is_base64 {
|
||||||
|
// See #1268
|
||||||
|
let bytes = bytes.move_iter().filter(|&b| b != ' ' as u8).collect::<Vec<u8>>();
|
||||||
// FIXME(#2877): use bytes.as_slice().from_base64() when we upgrade to a Rust version
|
// FIXME(#2877): use bytes.as_slice().from_base64() when we upgrade to a Rust version
|
||||||
// that includes https://github.com/rust-lang/rust/pull/15810
|
// that includes https://github.com/rust-lang/rust/pull/15810
|
||||||
let fake_utf8 = unsafe { str::raw::from_utf8(bytes.as_slice()) };
|
let fake_utf8 = unsafe { str::raw::from_utf8(bytes.as_slice()) };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue