mirror of https://github.com/LemmyNet/lemmy.git
comments
parent
3be2a55dd0
commit
44d8168b01
|
@ -25,6 +25,8 @@ async fn image_proxy(
|
|||
Query(params): Query<ImageProxyParams>,
|
||||
context: web::Data<LemmyContext>,
|
||||
) -> LemmyResult<HttpResponse> {
|
||||
// TODO: Check that url corresponds to a federated image so that this can't be abused as a proxy
|
||||
// for arbitrary purposes.
|
||||
let url = decode(¶ms.url)?.into_owned();
|
||||
let image_response = context.client().get(url).send().await?;
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ mod tests {
|
|||
"![My linked image](https://lemmy-alpha/image.png \"image alt text\")",
|
||||
"<p><img src=\"https://lemmy-alpha/image.png\" alt=\"My linked image\" title=\"image alt text\" /></p>\n"
|
||||
),
|
||||
// Ensure any custom plugins are added to 'MARKDOWN_PARSER' implementation.
|
||||
// Ensure spoiler plugin is added
|
||||
(
|
||||
"basic spoiler",
|
||||
"::: spoiler click to see more\nhow spicy!\n:::\n",
|
||||
|
|
Loading…
Reference in New Issue