Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update base64 to 0.10.1
  • Loading branch information
nox committed Jan 25, 2019
1 parent b1669b8 commit b9371c6
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 17 deletions.
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/net/Cargo.toml
Expand Up @@ -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"}
Expand Down
2 changes: 1 addition & 1 deletion components/net/data_loader.rs
Expand Up @@ -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,
}
Expand Down
2 changes: 1 addition & 1 deletion components/script/Cargo.toml
Expand Up @@ -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"
Expand Down
9 changes: 3 additions & 6 deletions components/script/dom/window.rs
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion components/webdriver_server/Cargo.toml
Expand Up @@ -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"
Expand Down

0 comments on commit b9371c6

Please sign in to comment.