[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:
parent
ca2b64a7ad
commit
0a6b097d4c
2 changed files with 3 additions and 3 deletions
|
@ -51,14 +51,14 @@ public partial class NotePreview(
|
||||||
note.Renote?.GetPublicUriOrNull(config.Value) ??
|
note.Renote?.GetPublicUriOrNull(config.Value) ??
|
||||||
throw new Exception("Note is remote but has no uri");
|
throw new Exception("Note is remote but has no uri");
|
||||||
|
|
||||||
Context.Response.Redirect(target, permanent: true);
|
Redirect(target);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (note is { User.Host: not null })
|
if (note is { User.Host: not null })
|
||||||
{
|
{
|
||||||
var target = note.Url ?? note.Uri ?? throw new Exception("Note is remote but has no uri");
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ public partial class UserPreview(
|
||||||
if (user is { IsRemoteUser: true })
|
if (user is { IsRemoteUser: true })
|
||||||
{
|
{
|
||||||
var target = user.UserProfile?.Url ?? user.Uri ?? throw new Exception("User is remote but has no uri");
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue