From 29eecc78873bfabf527c2982fab069cfea3c142f Mon Sep 17 00:00:00 2001 From: GHXX Date: Thu, 25 Jul 2024 04:00:06 +0200 Subject: [PATCH] fix incorrect check which might break when registering an endpoint class that contains no endpoints --- SimpleHttpServer/HttpServer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SimpleHttpServer/HttpServer.cs b/SimpleHttpServer/HttpServer.cs index d5cc3ee..02c126e 100644 --- a/SimpleHttpServer/HttpServer.cs +++ b/SimpleHttpServer/HttpServer.cs @@ -87,7 +87,7 @@ public sealed class HttpServer { private readonly Dictionary<(string path, string rType), EndpointInvocationInfo> simpleEndpointMethodInfos = new(); private static readonly Type[] expectedEndpointParameterTypes = new[] { typeof(RequestContext) }; public void RegisterEndpointsFromType() { - if (simpleEndpointMethodInfos.Count == 0) + if (stringToTypeParameterConverters.Count == 0) RegisterDefaultConverters(); var t = typeof(T);