From 5131f4fa20a7ba36a275aa03973602d34003ac56 Mon Sep 17 00:00:00 2001 From: Brian Cummings Date: Fri, 4 Apr 2025 09:04:46 -0400 Subject: [PATCH 1/2] Logging tweak --- PathfinderHonorManager/Program.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/PathfinderHonorManager/Program.cs b/PathfinderHonorManager/Program.cs index 1d417fb..7bd21f1 100644 --- a/PathfinderHonorManager/Program.cs +++ b/PathfinderHonorManager/Program.cs @@ -22,7 +22,6 @@ public static IHostBuilder CreateHostBuilder(string[] args) => }) .ConfigureLogging((hostingContext, logging) => { - logging.ClearProviders(); logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); logging.AddConsole(); logging.AddDebug(); From 20356eb5439942b14b037802d0fef49f4537a79a Mon Sep 17 00:00:00 2001 From: Brian Cummings Date: Fri, 4 Apr 2025 09:06:29 -0400 Subject: [PATCH 2/2] Added regex timeout --- PathfinderHonorManager/Validators/ClubValidator.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PathfinderHonorManager/Validators/ClubValidator.cs b/PathfinderHonorManager/Validators/ClubValidator.cs index 466a909..b5fbc90 100644 --- a/PathfinderHonorManager/Validators/ClubValidator.cs +++ b/PathfinderHonorManager/Validators/ClubValidator.cs @@ -2,6 +2,7 @@ using Microsoft.EntityFrameworkCore; using PathfinderHonorManager.DataAccess; using PathfinderHonorManager.Dto.Incoming; +using System; using System.Text.RegularExpressions; namespace PathfinderHonorManager.Validators @@ -26,7 +27,7 @@ private void SetUpValidation() RuleFor(c => c.ClubCode) .NotEmpty() .Length(4, 20) - .Matches(new Regex("^[A-Z0-9]+$")) + .Matches(new Regex("^[A-Z0-9]+$", RegexOptions.None, TimeSpan.FromMilliseconds(100))) .WithMessage("Club code must be between 4 and 20 characters and contain only uppercase letters and numbers."); RuleSet(