forked from alemi/upub
fix: correctly reconstruct urls for users too
This commit is contained in:
parent
6cb45bd5f0
commit
854fd95a4d
2 changed files with 2 additions and 10 deletions
|
@ -14,11 +14,7 @@ pub async fn view(
|
|||
AuthIdentity(auth): AuthIdentity,
|
||||
Query(query): Query<TryFetch>,
|
||||
) -> crate::Result<JsonLD<serde_json::Value>> {
|
||||
let oid = if id.starts_with('+') {
|
||||
format!("https://{}", id.replacen('+', "", 1).replace('@', "/"))
|
||||
} else {
|
||||
ctx.oid(id.clone())
|
||||
};
|
||||
let oid = ctx.uri("objects", id);
|
||||
if auth.is_local() && query.fetch && !ctx.is_local(&oid) {
|
||||
let obj = ctx.fetch_object(&oid).await?;
|
||||
// some implementations serve statuses on different urls than their AP id
|
||||
|
|
|
@ -19,11 +19,7 @@ pub async fn view(
|
|||
Path(id): Path<String>,
|
||||
Query(query): Query<TryFetch>,
|
||||
) -> crate::Result<JsonLD<serde_json::Value>> {
|
||||
let uid = if id.starts_with('+') {
|
||||
format!("https://{}", id.replacen('+', "", 1).replace('@', "/"))
|
||||
} else {
|
||||
ctx.uid(id.clone())
|
||||
};
|
||||
let uid = ctx.uri("users", id.clone());
|
||||
if auth.is_local() && query.fetch && !ctx.is_local(&uid) {
|
||||
ctx.fetch_user(&uid).await?;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue