From 2b67983fe27b08329b82b1a53ed0291ecf3ab321 Mon Sep 17 00:00:00 2001 From: sunaurus Date: Thu, 27 Jun 2024 08:33:59 +0300 Subject: [PATCH] Remove unnecessary URL decode --- Cargo.lock | 1 - crates/routes/Cargo.toml | 1 - crates/routes/src/images.rs | 3 +-- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a14147e09..71e97db9e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3155,7 +3155,6 @@ dependencies = [ "tokio", "tracing", "url", - "urlencoding", ] [[package]] diff --git a/crates/routes/Cargo.toml b/crates/routes/Cargo.toml index 0d18e4f1f..1e7f191c9 100644 --- a/crates/routes/Cargo.toml +++ b/crates/routes/Cargo.toml @@ -33,5 +33,4 @@ url = { workspace = true } once_cell = { workspace = true } tracing = { workspace = true } tokio = { workspace = true } -urlencoding = { workspace = true } rss = "2.0.8" diff --git a/crates/routes/src/images.rs b/crates/routes/src/images.rs index 049bd6cc8..b388e9cf0 100644 --- a/crates/routes/src/images.rs +++ b/crates/routes/src/images.rs @@ -22,7 +22,6 @@ use reqwest_middleware::{ClientWithMiddleware, RequestBuilder}; use serde::Deserialize; use std::time::Duration; use url::Url; -use urlencoding::decode; pub fn config( cfg: &mut web::ServiceConfig, @@ -219,7 +218,7 @@ pub async fn image_proxy( client: web::Data, context: web::Data, ) -> LemmyResult { - let url = Url::parse(&decode(¶ms.url)?)?; + let url = Url::parse(¶ms.url)?; // Check that url corresponds to a federated image so that this can't be abused as a proxy // for arbitrary purposes.