From 6bdcd92f9e918a0f1cd529ea081b8b397355d712 Mon Sep 17 00:00:00 2001 From: Steven He Date: Thu, 2 Nov 2023 22:41:49 +0900 Subject: [PATCH] feat: expose Kestrel options in appsettings.json (#163) Expose Kestrel options in appsettings.json to allow the customization to the web server. Fixes #163. --- src/GZCTF/Program.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/GZCTF/Program.cs b/src/GZCTF/Program.cs index dce9549c8..8c0037112 100644 --- a/src/GZCTF/Program.cs +++ b/src/GZCTF/Program.cs @@ -27,6 +27,13 @@ WebApplicationBuilder builder = WebApplication.CreateBuilder(args); +builder.WebHost.ConfigureKestrel(options => +{ + var kestrelSection = builder.Configuration.GetSection("Kestrel"); + options.Configure(kestrelSection); + kestrelSection.Bind(options); +}); + Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); GZCTF.Program.Banner();