From f6517179f8df5243ae20e4d78612ac145e52b00d Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 9 Aug 2024 11:07:09 -0400 Subject: [PATCH] Make site metadata fetch require auth. --- crates/api/src/post/get_link_metadata.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/api/src/post/get_link_metadata.rs b/crates/api/src/post/get_link_metadata.rs index 0669408aa..eb843233a 100644 --- a/crates/api/src/post/get_link_metadata.rs +++ b/crates/api/src/post/get_link_metadata.rs @@ -4,6 +4,7 @@ use lemmy_api_common::{ post::{GetSiteMetadata, GetSiteMetadataResponse}, request::fetch_link_metadata, }; +use lemmy_db_views::structs::LocalUserView; use lemmy_utils::{ error::{LemmyErrorExt, LemmyResult}, LemmyErrorType, @@ -14,6 +15,7 @@ use url::Url; pub async fn get_link_metadata( data: Query, context: Data, + _local_user_view: LocalUserView, ) -> LemmyResult> { let url = Url::parse(&data.url).with_lemmy_type(LemmyErrorType::InvalidUrl)?; let metadata = fetch_link_metadata(&url, &context).await?;