[backend/razor] Fix public preview redirects

Beyond actually working, we don't actually want to send permanent redirects here, as an auth state change might influence the response.
This commit is contained in:
Laura Hausmann 2025-03-15 01:48:00 +01:00
parent ca2b64a7ad
commit 0a6b097d4c
No known key found for this signature in database
GPG key ID: D044E84C5BE01605
2 changed files with 3 additions and 3 deletions

View file

@ -51,14 +51,14 @@ public partial class NotePreview(
note.Renote?.GetPublicUriOrNull(config.Value) ??
throw new Exception("Note is remote but has no uri");
Context.Response.Redirect(target, permanent: true);
Redirect(target);
return;
}
if (note is { User.Host: not null })
{
var target = note.Url ?? note.Uri ?? throw new Exception("Note is remote but has no uri");
Context.Response.Redirect(target, permanent: true);
Redirect(target);
return;
}

View file

@ -54,7 +54,7 @@ public partial class UserPreview(
if (user is { IsRemoteUser: true })
{
var target = user.UserProfile?.Url ?? user.Uri ?? throw new Exception("User is remote but has no uri");
Context.Response.Redirect(target, permanent: true);
Redirect(target);
return;
}