Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to base64 v0.21 #370

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ readme = "README.md"

[dependencies]
anyhow = "1"
base64 = "0.13"
base64 = "0.21"
derive_builder = "0.12"
directories = { version = "4.0", optional = true }
log = "0.4"
Expand Down
14 changes: 11 additions & 3 deletions src/browser/tab/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ use crate::protocol::cdp::{

use Runtime::AddBinding;

use base64::Engine;

use Input::DispatchKeyEvent;

use Page::{AddScriptToEvaluateOnNewDocument, Navigate, SetInterceptFileChooserDialog};
Expand Down Expand Up @@ -1049,7 +1051,9 @@ impl Tab {
capture_beyond_viewport: None,
})?
.data;
base64::decode(data).map_err(Into::into)
base64::prelude::BASE64_STANDARD
.decode(data)
.map_err(Into::into)
}

pub fn print_to_pdf(&self, options: Option<PrintToPdfOptions>) -> Result<Vec<u8>> {
Expand All @@ -1076,15 +1080,19 @@ impl Tab {
transfer_mode,
})?
.data;
base64::decode(data).map_err(Into::into)
base64::prelude::BASE64_STANDARD
.decode(data)
.map_err(Into::into)
} else {
let data = self
.call_method(Page::PrintToPDF {
..Default::default()
})?
.data;

base64::decode(data).map_err(Into::into)
base64::prelude::BASE64_STANDARD
.decode(data)
.map_err(Into::into)
}
}

Expand Down