Return error if trying to fetch local profile
This commit is contained in:
parent
86749a6ca1
commit
481d9a1509
1 changed files with 3 additions and 0 deletions
|
@ -129,6 +129,9 @@ pub async fn fetch_profile_by_actor_id(
|
|||
.host_str()
|
||||
.ok_or(FetchError::OtherError("invalid URL"))?
|
||||
.to_owned();
|
||||
if actor_host == instance.host() {
|
||||
return Err(FetchError::OtherError("trying to fetch local profile"));
|
||||
};
|
||||
let actor_json = send_request(instance, actor_url, &[]).await?;
|
||||
let actor_value: Value = serde_json::from_str(&actor_json)?;
|
||||
let actor: Actor = serde_json::from_value(actor_value.clone())?;
|
||||
|
|
Loading…
Reference in a new issue