From 768bb9f17528dac1bcb848136c36ff667cda2ca2 Mon Sep 17 00:00:00 2001 From: Aleksei Voronov Date: Sat, 7 Oct 2023 18:54:27 +0200 Subject: [PATCH] The feed parameter is an at-uri, not the feed name --- .../feed_server/endpoints/get_feed_skeleton.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/processes/feed_server/endpoints/get_feed_skeleton.rs b/src/processes/feed_server/endpoints/get_feed_skeleton.rs index 79daf1b..5f38687 100644 --- a/src/processes/feed_server/endpoints/get_feed_skeleton.rs +++ b/src/processes/feed_server/endpoints/get_feed_skeleton.rs @@ -18,9 +18,15 @@ pub async fn get_feed_skeleton( State(database): State>, query: Query, ) -> Result, AppError> { + let feed_name = query + .feed + .split('/') + .last() + .ok_or_else(|| anyhow!("Invalid feed URI"))?; + let algo = algos - .get_by_name(&query.feed) - .ok_or_else(|| AppError::FeedNotFound(query.feed.clone()))?; + .get_by_name(feed_name) + .ok_or_else(|| AppError::FeedNotFound(feed_name.to_owned()))?; let limit = query.limit.unwrap_or(20); let earlier_than = query.cursor.as_deref().map(parse_cursor).transpose()?;