From cb659cc8a3fa8e85e7fcd6c5e96d67fa83081c7b Mon Sep 17 00:00:00 2001 From: Martin Lindhe Date: Mon, 3 Feb 2025 04:00:58 +0100 Subject: [PATCH] rss: proxy links in users and subreddit feeds, fixes #359 (#361) --- src/subreddit.rs | 2 +- src/user.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/subreddit.rs b/src/subreddit.rs index d5d51961..0db4f770 100644 --- a/src/subreddit.rs +++ b/src/subreddit.rs @@ -605,7 +605,7 @@ pub async fn rss(req: Request) -> Result, String> { .into_iter() .map(|post| Item { title: Some(post.title.to_string()), - link: Some(utils::get_post_url(&post)), + link: Some(format_url(&utils::get_post_url(&post))), author: Some(post.author.name), content: Some(rewrite_urls(&post.body)), pub_date: Some(DateTime::from_timestamp(post.created_ts as i64, 0).unwrap_or_default().to_rfc2822()), diff --git a/src/user.rs b/src/user.rs index 2fb8b0d1..818f3680 100644 --- a/src/user.rs +++ b/src/user.rs @@ -164,7 +164,7 @@ pub async fn rss(req: Request) -> Result, String> { .into_iter() .map(|post| Item { title: Some(post.title.to_string()), - link: Some(utils::get_post_url(&post)), + link: Some(format_url(&utils::get_post_url(&post))), author: Some(post.author.name), pub_date: Some(DateTime::from_timestamp(post.created_ts as i64, 0).unwrap_or_default().to_rfc2822()), content: Some(rewrite_urls(&post.body)),