diff --git a/Foxnouns.Backend/Program.cs b/Foxnouns.Backend/Program.cs index f0c3e19..17a56d9 100644 --- a/Foxnouns.Backend/Program.cs +++ b/Foxnouns.Backend/Program.cs @@ -18,7 +18,7 @@ builder.AddSerilog(); builder .WebHost.UseSentry(opts => { - opts.Dsn = config.Logging.SentryUrl; + opts.Dsn = config.Logging.SentryUrl ?? ""; opts.TracesSampleRate = config.Logging.SentryTracesSampleRate; opts.MaxRequestBodySize = RequestSize.Small; }) diff --git a/Foxnouns.Backend/Utils/ValidationUtils.cs b/Foxnouns.Backend/Utils/ValidationUtils.cs index 0969a47..bb225ff 100644 --- a/Foxnouns.Backend/Utils/ValidationUtils.cs +++ b/Foxnouns.Backend/Utils/ValidationUtils.cs @@ -162,6 +162,7 @@ public static partial class ValidationUtils } public const int MaxBioLength = 1024; + public const int MaxAvatarLength = 1_500_000; public static ValidationError? ValidateBio(string? bio) { @@ -183,7 +184,10 @@ public static partial class ValidationUtils return avatar?.Length switch { 0 => ValidationError.GenericValidationError("Avatar cannot be empty", null), - > 1_500_000 => ValidationError.GenericValidationError("Avatar is too large", null), + > MaxAvatarLength => ValidationError.GenericValidationError( + "Avatar is too large", + null + ), _ => null, }; }