Skip to content

Commit

Permalink
bump
Browse files Browse the repository at this point in the history
  • Loading branch information
joshrmcdaniel committed Jun 3, 2024
1 parent 558fc88 commit 0d6b845
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions privaxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ path = "src/server/lib.rs"
hyper = { version = "0.14.23", features = ["full"] }
tokio = { version = "1.22.0", features = ["full"] }
serde_json = "1.0.89"
toml = "0.5.9"
toml = "0.8.13"
serde = { version = "1.0.148", features = ["derive"] }
tokio-util = { version = "0.7.4", features = ["full"] }
adblock = { version = "0.8.9" }
Expand All @@ -54,7 +54,7 @@ thiserror = "1.0.37"
url = "2.3.1"
futures = "0.3.25"
dirs = "4.0.0"
async-compression = { version = "0.3.15", features = ["futures-io", "gzip"] }
async-compression = { version = "0.4.11", features = ["futures-io", "gzip"] }
reqwest = { version = "0.11.13", features = [
"stream",
"rustls-tls",
Expand All @@ -65,7 +65,7 @@ reqwest = { version = "0.11.13", features = [
] }
once_cell = "1.16.0"
serde-tuple-vec-map = "1.0.1"
base64 = "0.13.1"
base64 = "0.22.1"
warp = "0.3.7"
sha2 = "0.10.8"
hex = "0.4.3"
Expand Down
7 changes: 4 additions & 3 deletions privaxy/src/server/blocker_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub struct ResourceProperties {
pub alias: Vec<String>,
pub data: Option<String>,

Check warning on line 23 in privaxy/src/server/blocker_utils.rs

View workflow job for this annotation

GitHub Actions / Run clippy check

field `data` is never read
}
use base64::{engine::general_purpose, Engine};

/// The deserializable represenation of the `alias` field of a resource's properties, which can
/// either be a single string or a list of strings.
Expand Down Expand Up @@ -185,7 +186,7 @@ pub fn read_template_resources(scriptlets_data: &str) -> Vec<Resource> {
.map(|aliases| aliases.iter().map(|alias| alias.to_string()).collect())
.unwrap_or_default(),
kind,
content: base64::encode(&script),
content: general_purpose::STANDARD.encode(&script),
dependencies: Vec::new(),
permission: PermissionMask::default(),
});
Expand Down Expand Up @@ -214,9 +215,9 @@ pub fn build_resource_from_file_contents(
let content = match mimetype {
MimeType::ApplicationJavascript | MimeType::TextHtml | MimeType::TextPlain => {
let utf8string = std::str::from_utf8(resource_contents).unwrap();
base64::encode(&utf8string.replace('\r', ""))
general_purpose::STANDARD.encode(&utf8string.replace('\r', ""))
}
_ => base64::encode(resource_contents),
_ => general_purpose::STANDARD.encode(resource_contents),
};

Resource {
Expand Down
2 changes: 1 addition & 1 deletion privaxy/src/server/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ impl Configuration {
};

match fs::read(&configuration_file_path).await {
Ok(bytes) => Ok(toml::from_slice(&bytes)?),
Ok(bytes) => Ok(toml::from_str(std::str::from_utf8(&bytes)?)?),
Err(err) => {
log::debug!("Configuration file not found, creating one");

Expand Down

0 comments on commit 0d6b845

Please sign in to comment.