mirror of https://github.com/LemmyNet/lemmy.git
Remove unnecessary URL decode
parent
d28c44112d
commit
2b67983fe2
|
@ -3155,7 +3155,6 @@ dependencies = [
|
||||||
"tokio",
|
"tokio",
|
||||||
"tracing",
|
"tracing",
|
||||||
"url",
|
"url",
|
||||||
"urlencoding",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
|
@ -33,5 +33,4 @@ url = { workspace = true }
|
||||||
once_cell = { workspace = true }
|
once_cell = { workspace = true }
|
||||||
tracing = { workspace = true }
|
tracing = { workspace = true }
|
||||||
tokio = { workspace = true }
|
tokio = { workspace = true }
|
||||||
urlencoding = { workspace = true }
|
|
||||||
rss = "2.0.8"
|
rss = "2.0.8"
|
||||||
|
|
|
@ -22,7 +22,6 @@ use reqwest_middleware::{ClientWithMiddleware, RequestBuilder};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
use urlencoding::decode;
|
|
||||||
|
|
||||||
pub fn config(
|
pub fn config(
|
||||||
cfg: &mut web::ServiceConfig,
|
cfg: &mut web::ServiceConfig,
|
||||||
|
@ -219,7 +218,7 @@ pub async fn image_proxy(
|
||||||
client: web::Data<ClientWithMiddleware>,
|
client: web::Data<ClientWithMiddleware>,
|
||||||
context: web::Data<LemmyContext>,
|
context: web::Data<LemmyContext>,
|
||||||
) -> LemmyResult<HttpResponse> {
|
) -> LemmyResult<HttpResponse> {
|
||||||
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
|
// Check that url corresponds to a federated image so that this can't be abused as a proxy
|
||||||
// for arbitrary purposes.
|
// for arbitrary purposes.
|
||||||
|
|
Loading…
Reference in New Issue