aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock14
-rw-r--r--components/net/Cargo.toml2
-rw-r--r--components/net/data_loader.rs2
-rw-r--r--components/script/Cargo.toml2
-rw-r--r--components/script/dom/window.rs9
-rw-r--r--components/webdriver_server/Cargo.toml2
6 files changed, 14 insertions, 17 deletions
diff --git a/Cargo.lock b/Cargo.lock
index de63ba40dfb..a6d4544e957 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -190,7 +190,7 @@ dependencies = [
[[package]]
name = "base64"
-version = "0.10.0"
+version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1924,7 +1924,7 @@ name = "influent"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "base64 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)",
"http 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.12.14 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2635,7 +2635,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
name = "net"
version = "0.0.1"
dependencies = [
- "base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
"brotli 3.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
"cookie 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3309,7 +3309,7 @@ version = "0.0.1"
dependencies = [
"app_units 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"bluetooth_traits 0.0.1",
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -4626,7 +4626,7 @@ dependencies = [
name = "webdriver_server"
version = "0.0.1"
dependencies = [
- "base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cookie 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"crossbeam-channel 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.19.4 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -4655,7 +4655,7 @@ version = "0.58.0"
source = "git+https://github.com/servo/webrender#2ff8da0eae0d695105a8d854129e4cf876724edb"
dependencies = [
"app_units 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "base64 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
"bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -4949,7 +4949,7 @@ dependencies = [
"checksum azure 0.35.0 (git+https://github.com/servo/rust-azure)" = "<none>"
"checksum backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "89a47830402e9981c5c41223151efcced65a0510c13097c769cede7efb34782a"
"checksum backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "c66d56ac8dabd07f6aacdaf633f4b8262f5b3601a810a0dcddffd5c22c69daa0"
-"checksum base64 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "621fc7ecb8008f86d7fb9b95356cd692ce9514b80a86d85b397f32a22da7b9e2"
+"checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e"
"checksum base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "85415d2594767338a74a30c1d370b2f3262ec1b4ed2d7bba5b3faf4de40467d9"
"checksum binary-space-partition 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "88ceb0d16c4fd0e42876e298d7d3ce3780dd9ebdcbe4199816a32c77e08597ff"
"checksum bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bda13183df33055cbb84b847becce220d392df502ebe7a4a78d7021771ed94d0"
diff --git a/components/net/Cargo.toml b/components/net/Cargo.toml
index 943e693da1d..af3b049cda3 100644
--- a/components/net/Cargo.toml
+++ b/components/net/Cargo.toml
@@ -14,7 +14,7 @@ test = false
doctest = false
[dependencies]
-base64 = "0.9"
+base64 = "0.10.1"
brotli = "3"
bytes = "0.4"
cookie_rs = {package = "cookie", version = "0.11"}
diff --git a/components/net/data_loader.rs b/components/net/data_loader.rs
index f467ed02b4f..31f32837a75 100644
--- a/components/net/data_loader.rs
+++ b/components/net/data_loader.rs
@@ -50,7 +50,7 @@ pub fn decode(url: &ServoUrl) -> Result<DecodeData, DecodeError> {
.into_iter()
.filter(|&b| b != b' ')
.collect::<Vec<u8>>();
- match base64::decode(&bytes) {
+ match base64::decode_config(&bytes, base64::STANDARD.decode_allow_trailing_bits(true)) {
Err(..) => return Err(DecodeError::NonBase64DataUri),
Ok(data) => bytes = data,
}
diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml
index cae434ab7d4..4ece839fdc6 100644
--- a/components/script/Cargo.toml
+++ b/components/script/Cargo.toml
@@ -32,7 +32,7 @@ tinyfiledialogs = "3.0"
[dependencies]
app_units = "0.7"
backtrace = {version = "0.3", optional = true}
-base64 = "0.9"
+base64 = "0.10.1"
bitflags = "1.0"
bluetooth_traits = {path = "../bluetooth_traits"}
byteorder = "1.0"
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs
index dce37b4f0bc..104060c25ba 100644
--- a/components/script/dom/window.rs
+++ b/components/script/dom/window.rs
@@ -509,12 +509,9 @@ pub fn base64_atob(input: DOMString) -> Fallible<DOMString> {
return Err(Error::InvalidCharacter);
}
- match base64::decode(&input) {
- Ok(data) => Ok(DOMString::from(
- data.iter().map(|&b| b as char).collect::<String>(),
- )),
- Err(..) => Err(Error::InvalidCharacter),
- }
+ let data = base64::decode_config(&input, base64::STANDARD.decode_allow_trailing_bits(true))
+ .map_err(|_| Error::InvalidCharacter)?;
+ Ok(data.iter().map(|&b| b as char).collect::<String>().into())
}
impl WindowMethods for Window {
diff --git a/components/webdriver_server/Cargo.toml b/components/webdriver_server/Cargo.toml
index 5e4a6292cbe..1a80782db35 100644
--- a/components/webdriver_server/Cargo.toml
+++ b/components/webdriver_server/Cargo.toml
@@ -11,7 +11,7 @@ name = "webdriver_server"
path = "lib.rs"
[dependencies]
-base64 = "0.9"
+base64 = "0.10"
cookie = "0.11"
crossbeam-channel = "0.3"
euclid = "0.19"