Redirect to user page rather than returning blank 400

This commit is contained in:
sudokoko 2024-03-27 23:48:55 -04:00
commit d078afd99a
No known key found for this signature in database
GPG key ID: 248D68C664937395

View file

@ -44,7 +44,7 @@ public class UserSettingsPage : BaseLayout
if (avatarHash != null)
{
// Deny request if in read-only mode
if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.BadRequest();
if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.Redirect($"~/user/{userId}");
this.ProfileUser.IconHash = avatarHash;
}
@ -54,7 +54,7 @@ public class UserSettingsPage : BaseLayout
if (biography != null)
{
// Deny request if in read-only mode
if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.BadRequest();
if (ServerConfiguration.Instance.UserGeneratedContentLimits.ReadOnlyMode) return this.Redirect($"~/user/{userId}");
biography = CensorHelper.FilterMessage(biography);
if (this.ProfileUser.Biography != biography && biography.Length <= 512)